leetcode
qq_37954325
这个作者很懒,什么都没留下…
展开
-
leetcode.0014. Longest Common Prefix
leetcode.0014. Longest Common Prefix 题目 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 “”. Example 1:...原创 2018-07-21 10:39:17 · 156 阅读 · 0 评论 -
双指针类
双指针类 有序数组的 Two Sum leetcode.0167. Two Sum II - Input array is sorted Input: numbers = [2,7,11,15], target = 9 Output: [1,2] Explanation: The sum of 2 and 7 is 9. Therefore index1 = 1, index2 ...转载 2018-08-31 10:50:14 · 207 阅读 · 0 评论 -
leetcode.0167. Two Sum II - Input array is sorted
leetcode.0167. Two Sum II - Input array is sorted 题目 Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The ...原创 2018-08-17 12:37:50 · 141 阅读 · 0 评论 -
leetcode.0021. Merge Two Sorted Lists
leetcode.0021. Merge Two Sorted Lists 题目 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 lists. Example: ...转载 2018-07-27 15:19:26 · 139 阅读 · 0 评论 -
leetcode.0007. Reverse Integer
leetcode.0007. Reverse Integer 题目 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: In...原创 2018-07-17 20:31:25 · 130 阅读 · 0 评论 -
leetcode.0020. Valid Parentheses
leetcode.0020. Valid Parentheses 题目 Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. An input string is valid if: - Open br...转载 2018-07-25 22:32:16 · 130 阅读 · 0 评论 -
leetcode.0013. Roman to Integer
leetcode.0013. Roman to Integer 题目 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M Symbol Value I 1 V 5 X 10 L ...原创 2018-07-20 17:16:01 · 177 阅读 · 0 评论 -
leetcode.0001 two sum
leetcode.0001 two sum 题目: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution,...原创 2018-07-17 20:31:53 · 144 阅读 · 0 评论 -
leetcode.0009. Palindrome Number
leetcode0009. Palindrome Number 题目 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true ...原创 2018-07-18 17:16:43 · 110 阅读 · 0 评论 -
leetcode.0633. Sum of Square Numbers
leetcode.0633. Sum of Square Numbers Input: 5 Output: True Explanation: 1 * 1 + 2 * 2 = 5 题目描述:判断一个数是否为两个数的平方和,例如 5 = 1^2 + 2^2。 C++ class Solution { public: bool judgeSquareSum(int c) { ...原创 2018-08-30 12:44:55 · 163 阅读 · 0 评论