Category: greedy algorithm
Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. If it is impossible to form …
Given an array A of integers, for each integer A we may choose any x with -K <= x <= K, and add x to A. After this process, …
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 …