For a given array [ ] arr , calculates the maximum j a i such that arr [ j ] > arr [ i ]
using System ; class GFG { public static void Main ( String [ ] args ) { int [ ] v = { 34 , 8 , 10 , 3 , 2 , 80 , 30 , 33 , 1 } ; int n = v . Length ; int [ ] maxFromEnd = new int [ n + 1 ] ; for ( int i = 0 ; i < maxFromEnd . Length ; i ++ ) maxFromEnd [ i ] = int . MinValue ;