Tag: greedy algorithm
We are given an array A of N lowercase letter strings, all of the same length. Now, we may choose any set of deletion indices, and for each string, …
A kangaroo is at one side of the river. There are N springs in the river, each is separated 1 meter, like this: K| . . . . . …
Arrange a list of non negative integers such that they form the largest number. For example, given , the largest formed number is 9534330. The result may be very …
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array , the contiguous subarray has the largest …
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You …