摘要:
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2, 阅读全文
摘要:
从十月份开始到现在,差不多近3个月时间吧。中间有的时候有事没有办法刷题,也有的题目比较难,比较麻烦,会浪费很多时间,71道题,也都是简单的。下图是最后20道刷题的记录吧。完成自己的目标是轻松的。之后会减慢刷题的节奏,也要做做总结。毕竟还有别的事情要做。 阅读全文
摘要:
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below a... 阅读全文
摘要:
Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 val2) return 1;20 if(val1<val2) return -1;... 阅读全文
摘要:
Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].首先题意理... 阅读全文
摘要:
Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
摘要:
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
摘要:
Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].Credits... 阅读全文
摘要:
Description:Count the number of prime numbers less than a non-negative number, n.Credits:Special thanks to @mithmatt for adding this problem and creat... 阅读全文
摘要:
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font ... 阅读全文
摘要:
Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers.Have you thought about this?Here are some good questions to ask be... 阅读全文
摘要:
Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Subscribe to see which com... 阅读全文
摘要:
Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->... 阅读全文
摘要:
Given two binary strings, return their sum (also a binary string).For example, a = "11" b = "1" Return "100". Subscribe to see which companies asked t... 阅读全文
摘要:
Given a singly linked list, determine if it is a palindrome.Follow up: Could you do it in O(n) time and O(1) space?Subscribe to see which companies as... 阅读全文