58. Length of Last Word 题目 Given a string s consists of upper/lower-case alphabets and empty space characters …
分类:LeetCode
[LeetCode] Jump Game 跳跃游戏
Given an array of non-negative integers, you are initially positioned at the first index of the array. …
[LeetCode] Valid Number 验证数字
Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc"…
[LeetCode] Smallest Range 最小的范围
You have k lists of sorted integers in ascending order. Find the smallest range tha…
LeetCode 091 Decode Ways
题目描述 A message containing letters from A-Z is being encoded to numbers using the following mapping: ‘A’ -> …
318. Maximum Product of Word Lengths
Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do…
007 Reverse Integer[E]
1 题目描述 Given a 32-bit signed integer, reverse digits of an integer. 难度:Easy 2 题目样例 Example 1: Input: 123 Outpu…
Leetcode222-Count Complete Tree Nodes
写在前面: 说起刷题我需要提到大学本科时的一位舍友@团长,当时我说我想去找实习,他推荐我去刷《剑指offer》。去年一年断断续续的刷完了《剑指offer》。之后又刷了左大大的《程序员面试算法宝典》。来这之后开始刷Leet…
28. 实现strStr()
一、题目原型: 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回 -1。 二、示例剖析: 输入: …
762. Prime Number of Set Bits in Binary Representation
题目地址:https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation/description/ 大意:判断一个整数转化为…
68. Text Justification
Hard 也是太messy的一道题了, discussion里面有一个post还是蛮有意思的,讨论这道题的意义:What does this question aim to teach? 今日最佳: it teaches…
[Leetcode]8. 字符串转换整数 (atoi)
题目描述: 请你来实现一个 atoi 函数,使其能将字符串转换成整数。 首先,该函数会根据需要丢弃无用的开头空格字符,直到寻找到第一个非空格的字符为止。 当我们寻找到的第一个非空字符为正或者负号时,则将该符号与之后面尽可…