摘要:
Implement int sqrt(int x).
Compute and return the square root of x.
Have you met this question in a real interview? Yes
Example
sqrt(3) = 1
sqrt(4) =... 阅读全文
摘要:
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 target number... 阅读全文
摘要:
Given an integer array, find a subarray with sum closest to zero. Return the indexes of the first number and last number.
Have you met this question ... 阅读全文
摘要:
Given an array nums of integers and an int k, partition the array (i.e move the elements in "nums") such that:All elements < k are moved to the leftA... 阅读全文
摘要:
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 ... 阅读全文