原创 [leetcode] 93.Restore IP Addresses
題目: Given a string containing only digits, restore it by returning all possible valid IP address combinations. For
原创 [leetcode] 13.Roman to Integer
題目: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 題
原创 [leetcode] 12.Integer to Roman
題目: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 題
原创 [leetcode] 43.Multiply Strings
題目: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers
原创 [leetcode] 141.Linked List Cycle
題目: Given a linked list, determine if it has a cycle in it. 題意: 判斷一個鏈表是否存在環。 思路: 使用快慢兩個指針,一個一次走一步,一個一次走兩步。 代碼
原创 [leetcode] 72.Edit Distance
題目: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each op
原创 [leetcode]32.Longest Valid Parentheses
題目: Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed)
原创 [leetcode] 10.Regular Expression Matching
題目: Implement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Mat
原创 [leetcode] 97.Interleaving String
題目: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given: s1 = “aabc
原创 [leetcode] 20.Valid Parentheses
題目: Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string i
原创 [leetcode] 71.Simplify Path
題目: Given an absolute path for a file (Unix-style), simplify it. For example, path = “/home/”, => “/home” path =
原创 [leetcode] 58.Length of Last Word
題目: Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of l
原创 [leetcode] 3.Longest Substring Without Repeating Characters
題目: Given a string, find the length of the longest substring without repeating characters. For example, the longes
原创 [leetcode] 28.Implement strStr()
題目: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not pa
原创 [leetcode] 125.Valid Palindrome
題目: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.