上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 27 下一页
摘要: Given a binary tree, find the leftmost value in the last row of the tree.Example 1:Input: 2 / \ 1 3 Output: 1 Example 2: Input: 1 / \ 2 3 / / \ 4 5 ... 阅读全文
posted @ 2017-08-13 22:28 xiejunzhao 阅读(223) 评论(0) 推荐(0)
摘要: Given a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substrings even they consist of... 阅读全文
posted @ 2017-08-13 21:39 xiejunzhao 阅读(256) 评论(0) 推荐(0)
摘要: Given two strings representing two complex numbers.You need to return a string representing their multiplication. Note i2 = -1 according to the definition.Example 1:Input: "1+1i", "1+1i" Output: "0+2i... 阅读全文
posted @ 2017-08-13 21:13 xiejunzhao 阅读(321) 评论(0) 推荐(0)
摘要: Given an integer array with no duplicates. A maximum tree building on this array is defined as follow:The root is the maximum number in the array.The left subtree is the maximum tree constructed from ... 阅读全文
posted @ 2017-08-12 23:03 xiejunzhao 阅读(305) 评论(0) 推荐(0)
摘要: Description:Count the number of prime numbers less than a non-negative number, n.求0-n的素数个数,使用埃拉托斯特尼筛法要得到自然数n以内的全部素数,必须把不大于 的所有素数的倍数剔除,剩下的就是素数。给出要筛数值的范围n,找出以内的素数。先用2去筛,即把2留下,把2的倍数剔除掉;再用下一个质数,也就是3筛,把3留... 阅读全文
posted @ 2017-08-10 23:34 xiejunzhao 阅读(190) 评论(0) 推荐(0)
摘要: Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask before coding. Bonus poi... 阅读全文
posted @ 2017-08-09 23:04 xiejunzhao 阅读(149) 评论(0) 推荐(0)
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a palindro... 阅读全文
posted @ 2017-08-08 23:35 xiejunzhao 阅读(251) 评论(0) 推荐(0)
摘要: Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note:Try to come up as many solutions as you can, there... 阅读全文
posted @ 2017-08-08 23:35 xiejunzhao 阅读(149) 评论(0) 推荐(0)
摘要: Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.Example 1:Input: 5 / \ 3 6 / \ \ 2 ... 阅读全文
posted @ 2017-08-06 20:28 xiejunzhao 阅读(785) 评论(0) 推荐(0)
摘要: Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Example 1:Input: [3, 2, 1] Out... 阅读全文
posted @ 2017-08-05 19:56 xiejunzhao 阅读(227) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 27 下一页