问个google面试题# JobHunting - 待字闺中
B*1
1 楼
Suppose we can compare two arrays like:
{4,2,3} > {3,5,6}
{4,2,3} < {4,3,0}
In each move, you can only switch a number with one of its neighbor. Given
an array and a number n, design an algorithm to make this array maximum
using n moves. (needs clarification)
{4,2,3} > {3,5,6}
{4,2,3} < {4,3,0}
In each move, you can only switch a number with one of its neighbor. Given
an array and a number n, design an algorithm to make this array maximum
using n moves. (needs clarification)