Maximum Fixed Point ( Value equal to index ) in a given Array | ''Python implementation of the above approach Function to find the maximum index i such that arr[i] is equal to i ; '' Traversing the array from  backwards ; '' If arr[i] is equal to i ; '' If there is no such index ; Given Input ; ''Function Call
def findLargestIndex ( arr , n ) : NEW_LINE INDENT for i in range ( n ) : NEW_LINE INDENT if ( arr [ i ] == i ) : NEW_LINE INDENT print ( i ) NEW_LINE return NEW_LINE DEDENT DEDENT print ( - 1 ) NEW_LINE DEDENT arr = [ - 10 , - 5 , 0 , 3 , 7 ] NEW_LINE n = len ( arr ) NEW_LINE findLargestIndex ( arr , n ) NEW_LINE