leetcode by python
thyme_C
这个作者很懒,什么都没留下…
展开
-
leetcode 20: valid parentheses
题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type...原创 2018-11-06 12:57:05 · 190 阅读 · 0 评论 -
leetcode 14: 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:Input: ["flower","flow","flight"]Ou...原创 2018-11-05 13:38:45 · 106 阅读 · 0 评论 -
leetcode 13: Roman to Integer
题目:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C 100D ...原创 2018-11-05 12:30:13 · 110 阅读 · 0 评论 -
leetcode 9: 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: 121Output: trueExample 2:Input: -121Output: false...原创 2018-11-05 10:34:39 · 126 阅读 · 0 评论 -
leetcode 27: Remove Element
题目: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 for another array, you must do this by modifying the input...原创 2018-11-07 21:15:27 · 94 阅读 · 0 评论 -
leetcode 26: Remove Duplicates from Sorted Array
题目:Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by mo...原创 2018-11-07 20:52:52 · 93 阅读 · 0 评论 -
leetcode 7:Reverse Integer
题目:Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are d...原创 2018-11-05 02:32:11 · 105 阅读 · 0 评论 -
leetcode 1: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, and you may not use the ...原创 2018-11-05 02:02:42 · 94 阅读 · 0 评论 -
leetcode 21: Merge Two Sorted List
题目: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:Input: 1->2->4, 1->3->4Outpu...原创 2018-11-06 13:31:24 · 114 阅读 · 0 评论 -
leetcode 771: Jewels and Stones
题目:You're given strings J representing the types of stones that are jewels, and Srepresenting the stones you have. Each character in S is a type of stone you have. You want to know how many of the...原创 2018-11-05 13:51:03 · 131 阅读 · 0 评论