A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to determine if a number i... ...
分类:
其他好文 时间:
2017-11-27 13:30:16
阅读次数:
161
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target va ...
分类:
其他好文 时间:
2017-11-13 11:35:15
阅读次数:
162
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You a ...
分类:
其他好文 时间:
2017-10-16 09:45:38
阅读次数:
195
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]. Not ...
分类:
其他好文 时间:
2017-10-14 22:32:12
阅读次数:
183
Introduction While working on a project for school, I found it necessary to perform a collision check between sprites that had been translated and rot ...
分类:
其他好文 时间:
2017-10-10 21:57:46
阅读次数:
216
class Solution { public boolean search(int[] nums, int target) { if(nums.length==0) return false; int lo=0; int hi=nums.length-1; while(lonums[hi]) ..... ...
分类:
其他好文 时间:
2017-09-27 13:32:59
阅读次数:
146
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target va ...
分类:
其他好文 时间:
2017-09-24 10:48:13
阅读次数:
158
public class Solution { public int search(int[] nums, int target) { int l=0; int r=nums.length-1; while(l<r) { int m=l+(r-l)/2; if(nums[m]=... ...
分类:
其他好文 时间:
2017-09-23 14:26:28
阅读次数:
116
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. ...
分类:
其他好文 时间:
2017-09-23 10:44:03
阅读次数:
147
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. ...
分类:
其他好文 时间:
2017-09-23 10:32:33
阅读次数:
147