
LeetCode
文章平均质量分 56
超级大黄狗Shawn
这个作者很懒,什么都没留下…
展开
-
LeetCode Python 532 K-diff Pairs in an Array
Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pair (i, j), where i and j are both numbers in...原创 2018-07-24 10:08:48 · 371 阅读 · 0 评论 -
LeetCode Python 290 Word Pattern
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str. Exampl...原创 2018-07-25 15:37:43 · 363 阅读 · 0 评论 -
LeetCode Python 001 TwoSum
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 same ...原创 2018-07-20 17:00:46 · 238 阅读 · 0 评论 -
LeetCode Python 665 Non-decreasing Array
Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element. We define an array is non-decreasing if array[i] <= array[i + 1] holds for e...原创 2018-07-20 17:47:55 · 369 阅读 · 0 评论 -
LeetCode Python 796 Rotate String
We are given two strings, A and B. A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = ‘abcde’, then it will be ‘bcdea’ after one...原创 2018-07-26 14:45:18 · 243 阅读 · 0 评论 -
LeetCode Python 292 Nim Game
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the...原创 2018-08-03 16:14:20 · 329 阅读 · 0 评论 -
LeetCode Python 065 Valid Number
Validate if a given string is numeric. Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one. Example: "0" => true "...原创 2018-08-01 11:52:57 · 208 阅读 · 0 评论