1 2 3 4 5 ··· 10 下一页
摘要: 1、Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum o 阅读全文
posted @ 2016-06-21 09:49 dylqt 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of two. Given an integer, write a function to determine if it is a power of two. Give 阅读全文
posted @ 2016-06-15 14:38 dylqt 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Majority Element Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You ma 阅读全文
posted @ 2016-06-15 14:37 dylqt 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 阅读全文
posted @ 2016-06-15 14:37 dylqt 阅读(110) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2016-06-15 14:36 dylqt 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Valid Anagram Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true. 阅读全文
posted @ 2016-06-15 14:36 dylqt 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2016-06-15 14:35 dylqt 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Implement int sqrt(int x). Compute and return the square root of x. 自己的代码: 1 int mySqrt(int x) { 2 if(x == 0 || x == 1) 3 return x; 4 int begin = 0; 5 阅读全文
posted @ 2016-02-21 11:11 dylqt 阅读(240) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the... 阅读全文
posted @ 2016-01-19 10:29 dylqt 阅读(231) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which... 阅读全文
posted @ 2016-01-18 11:09 dylqt 阅读(305) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 10 下一页