上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 27 下一页
摘要: Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the root.Note: The length of path between two nodes is re... 阅读全文
posted @ 2017-10-10 20:33 xiejunzhao 阅读(187) 评论(0) 推荐(0)
摘要: Implement a MapSum class with insert, and sum methods.For the method insert, you'll be given a pair of (string, integer). The string represents the key and the integer represents the value. If the key... 阅读全文
posted @ 2017-10-10 20:33 xiejunzhao 阅读(353) 评论(0) 推荐(0)
摘要: Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.Example 1:Input: 5 Output: True Explanation: The binary representation o... 阅读全文
posted @ 2017-10-08 22:08 xiejunzhao 阅读(195) 评论(0) 推荐(0)
摘要: Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrou... 阅读全文
posted @ 2017-10-08 21:58 xiejunzhao 阅读(1576) 评论(0) 推荐(0)
摘要: Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1.For example, with A = "abcd" and B = "cdabcdab".Return... 阅读全文
posted @ 2017-10-04 23:09 xiejunzhao 阅读(208) 评论(0) 推荐(0)
摘要: Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N numbers successfully if one of the following is true for the ith position (1 N: ... 阅读全文
posted @ 2017-09-29 22:39 xiejunzhao 阅读(341) 评论(0) 推荐(0)
摘要: You are given a data structure of employee information, which includes the employee's unique id, his importance value and his direct subordinates' id.For example, employee 1 is the leader of employee ... 阅读全文
posted @ 2017-09-29 22:30 xiejunzhao 阅读(433) 评论(0) 推荐(0)
摘要: You're now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:Integer (one round's score): Directly represents the number of points you get in this... 阅读全文
posted @ 2017-09-25 00:01 xiejunzhao 阅读(1074) 评论(0) 推荐(0)
摘要: Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.Example 1:Input: "aba" Output: True Example 2:Input: "abca" Output: True Explanation: You c... 阅读全文
posted @ 2017-09-19 23:26 xiejunzhao 阅读(504) 评论(0) 推荐(0)
摘要: Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4.However, you can add any number of parenthesis at any position to change the... 阅读全文
posted @ 2017-09-16 11:18 xiejunzhao 阅读(207) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 27 下一页