随笔分类 - 刷题
摘要:LeetCode第58题: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If
阅读全文
摘要:Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: 翻译:
阅读全文
摘要:LeetCode第38题 The count-and-say sequence is the sequence of integers with the first five terms as following: 1 is read off as "one 1" or 11.11 is read
阅读全文
摘要:LeetCode第28题 Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Example 2: 翻译: 返回大字符串
阅读全文
摘要:LeetCode第27题 Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space f
阅读全文
摘要:LeetCode第26题 Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not alloc
阅读全文
摘要:LeetCode第21题 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two li
阅读全文
摘要:LeetCode第20题 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is
阅读全文
摘要:Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl
阅读全文
摘要:LeetCode第13题 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, ju
阅读全文
摘要:LeetCode第9题 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2:
阅读全文
摘要:LeetCode第7题: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an environm
阅读全文