原创 leetCode:215. Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not th
原创 leetcode:468. Validate IP Address
Write a function to check whether an input string is a valid IPv4 address or IPv6 address or neither. IPv4 addresses
原创 leetcode:44. Wildcard Matching
Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matches any
原创 leetCode:493. Reverse Pairs
Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j]. You need to return
原创 leetcode:115. Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a
原创 87. Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Bel
原创 leetcode:125. Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For e
原创 leetcode:72. Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation
原创 leetcode:67. Add Binary
Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1" Return "100". 題意&解題思路
原创 leetcode:459. Repeated Substring Pattern
Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of t
原创 leetcode:49. Group Anagrams
Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"],
原创 leetcode:338. Counting Bits
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in th
原创 leetcode:17. Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to
原创 leetcode:413. Arithmetic Slices
A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any t
原创 28. Implement strStr()
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of hay