摘要:
描述 两个整数的Hamming距离是对应比特位不同的个数。 给定两个整数x和y,计算两者的Hamming距离。 0 ≤ x, y 1; y = y 1; } return res; } } ``` 阅读全文
posted @ 2019-04-02 21:44
故人叹
阅读(202)
评论(0)
推荐(0)
摘要:
描述 给定一个排序数组和一个目标值,如果在数组中找到目标值则返回索引。如果没有,返回到它将会被按顺序插入的位置。 你可以假设在数组中无重复元素。 您在真实的面试中是否遇到过这个题? 样例 挑战 O(log(n)) time 阅读全文
posted @ 2019-04-02 21:43
故人叹
阅读(125)
评论(0)
推荐(0)
摘要:
描述 合并两个排序的整数数组A和B变成一个新的数组。 你可以假设A具有足够的空间(A数组的大小大于或等于m+n)去添加B中的元素。 您在真实的面试中是否遇到过这个题? 样例 给出 A = , B = 合并之后 A 将变成 public class Solution { / @param A: sor 阅读全文
posted @ 2019-04-02 21:43
故人叹
阅读(111)
评论(0)
推荐(0)
摘要:
描述 给一个整数数组,找到两个数使得他们的和等于一个给定的数 target。 你需要实现的函数twoSum需要返回这两个数的下标, 并且第一个下标小于第二个下标。注意这里下标的范围是 0 到 n 1。 你可以假设只有一组答案。 您在真实的面试中是否遇到过这个题? 样例 给出 numbers = , 阅读全文
posted @ 2019-04-02 21:42
故人叹
阅读(117)
评论(0)
推荐(0)
摘要:
Description Given a rotated sorted array, recover it to sorted array in place. Clarification What is rotated array? For example, the orginal array is 阅读全文
posted @ 2019-04-02 21:42
故人叹
阅读(104)
评论(0)
推荐(0)
摘要:
Description Reverse a linked list. Example For linked list , the reversed linked list is 阅读全文
posted @ 2019-04-02 21:41
故人叹
阅读(77)
评论(0)
推荐(0)
摘要:
描述 Given a non overlapping interval list which is sorted by start point. Insert a new interval into it, make sure the list is still in order and non o 阅读全文
posted @ 2019-04-02 21:41
故人叹
阅读(68)
评论(0)
推荐(0)
摘要:
Description 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 阅读全文
posted @ 2019-04-02 21:41
故人叹
阅读(116)
评论(0)
推荐(0)
摘要:
Description For a given sorted array (ascending order) and a target number, find the first index of this number in O(log n) time complexity. If the ta 阅读全文
posted @ 2019-04-02 21:40
故人叹
阅读(90)
评论(0)
推荐(0)
摘要:
13. Implement strStr() Description For a given source string and a target string, you should output the first index(from 0) of target string in source 阅读全文
posted @ 2019-04-02 21:40
故人叹
阅读(143)
评论(0)
推荐(0)

浙公网安备 33010602011771号