阅读背景:

CareerCup Given an array A[], find (i, j) such that A[i] < A[j] and (j - i) is maximum.

来源:互联网 
O(n) time and O(n) space solution. Tested! The key observation is the two auxiliary arrays LMin and RMax which saves the smallest value left of i and biggest value right of iO(n) time and O(n) space solution. Tested! The key


你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: