A race track is represented as a line segment. You are given its length, and a int[] pos containing the positions where judges may be located. Each element of pos is the distance from the starting point of the race track. The elements of pos are given in strictly increasing order (pos[i] < pos[i+1]).
You are given an int judges, the number of judges in the next competition. You must assign the judges to positions such that the distance between the two closest judges is as large as possible. Return a String containing exactly n characters, where n is the number of elements in pos. The i-th character should be '1' (one) if there is a judge assigned to the i-th position, and '0' (zero) if there is not. The judges are lazy and don't want to go far from the starting point, so if there are multiple optimal solutions, return the one that comes latest lexicographically.
|