上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页
摘要: Given an integer array, find a subarray where the sum of numbers is zero. Your code should return the index of the first number and the index of the l 阅读全文
posted @ 2016-03-07 08:04 哥布林工程师 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Implement int sqrt(int x). Compute and return the square root of x. sqrt(3) = 1 sqrt(4) = 2 sqrt(5) = 2 sqrt(10) = 3 mid*mid 以及 (mid + 1) * (mid + 1)都 阅读全文
posted @ 2016-03-07 07:53 哥布林工程师 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Write a method to replace all spaces in a string with%20. The string is given in a characters array, you can assume it has enough space for replacemen 阅读全文
posted @ 2016-03-07 07:29 哥布林工程师 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Singleton is a most widely used design pattern. If a class has and only has one instance at every moment, we call this design as singleton. For exampl 阅读全文
posted @ 2016-03-07 07:11 哥布林工程师 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Given 2*n + 1 numbers, every numbers occurs twice except one, find it. Given [1,2,2,1,3,4,3], return 4 因为所有数都出现了两次,只有一个出现一次,所以只要把所有数做XOR,就可以得到出现一次的数 p 阅读全文
posted @ 2016-03-07 07:05 哥布林工程师 阅读(80) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文
posted @ 2016-03-07 07:03 哥布林工程师 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文
posted @ 2016-03-07 06:54 哥布林工程师 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Given a string and an offset, rotate string by offset. (rotate from left to right) Given "abcdefg". offset=0 => "abcdefg" offset=1 => "gabcdef" offset 阅读全文
posted @ 2016-03-07 06:37 哥布林工程师 阅读(328) 评论(0) 推荐(0) 编辑
摘要: Given an input string, reverse the string word by word. For example,Given s = "the sky is blue",return "blue is sky the". Clarification What constitut 阅读全文
posted @ 2016-03-07 06:11 哥布林工程师 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Reverse a linked list. For linked list 1->2->3, the reversed linked list is 3->2->1 /** * Definition for ListNode. * public class ListNode { * int val 阅读全文
posted @ 2016-03-06 10:37 哥布林工程师 阅读(153) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页