摘要: Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree.Example :Input: root = [4,2,6,1,3,null,null] Output: 1... 阅读全文
posted @ 2018-02-12 23:11 xiejunzhao 阅读(444) 评论(0) 推荐(0) 编辑
摘要: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Example:I... 阅读全文
posted @ 2018-02-12 23:09 xiejunzhao 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.1234567891011121314151617181920212223242526class Solution: def intToRoman(self, num): ... 阅读全文
posted @ 2018-02-12 23:08 xiejunzhao 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with ... 阅读全文
posted @ 2018-02-12 23:06 xiejunzhao 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Given a list of 24-hour clock time points in "Hour:Minutes" format, find the minimum minutes difference between any two time points in the list.Example 1:Input: ["23:59","00:00"] Output: 1 Note:The nu... 阅读全文
posted @ 2018-02-12 23:03 xiejunzhao 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2.Note:The length of both num1 and num2 is < 110.Both num1 and num2 contains only digits 0-9.Bot... 阅读全文
posted @ 2018-02-12 22:58 xiejunzhao 阅读(157) 评论(0) 推荐(0) 编辑
摘要: You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return i... 阅读全文
posted @ 2018-02-12 22:56 xiejunzhao 阅读(189) 评论(0) 推荐(0) 编辑
摘要: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i... 阅读全文
posted @ 2018-02-12 22:55 xiejunzhao 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given a string representing an expression of fraction addition and subtraction, you need to return the calculation result in string format. The final result should be irreducible fraction. If your fin... 阅读全文
posted @ 2018-02-12 22:53 xiejunzhao 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n.Example: Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x < 100, excludi... 阅读全文
posted @ 2018-02-12 22:35 xiejunzhao 阅读(181) 评论(0) 推荐(0) 编辑