Tag: algorithm
A kangaroo is at one side of the river. There are N springs in the river, each is separated 1 meter, like this: K| . . . . . …
Given an array of sorted integers and a target, find the index of the target in the array, if not found, return -1. Given a sorted (in ascending order) …
Given a API guess(int num) which will return three possible results (0 – you guess right, -1 my answer lower, and 1 my answer higher), your task is to …
Given two non-negative integers represented by strings, return the sum of both. You should not use any BigInteger library nor convert the inputs to integer types directly, as the …
An array is called monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A <= A. …