Find the index with minimum score from a given array | Function to find the index with minimum score ; Stores the score of current index ; Traverse the array in reverse ; Update minimum score ; Print the index with minimum score ; Driver Code
def Min_Score_Index ( N , A ) : NEW_LINE INDENT Score = [ 0 ] * N NEW_LINE for i in range ( N - 1 , - 1 , - 1 ) : NEW_LINE INDENT if A [ i ] + i < N : NEW_LINE INDENT Score [ i ] = A [ i ] * Score [ A [ i ] + i ] NEW_LINE DEDENT else : NEW_LINE INDENT Score [ i ] = A [ i ] NEW_LINE DEDENT DEDENT min_value = min ( Score ) NEW_LINE ind = Score . index ( min_value ) NEW_LINE print ( ind ) NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = 5 NEW_LINE A = [ 1 , 2 , 3 , 4 , 5 ] NEW_LINE Min_Score_Index ( N , A ) NEW_LINE DEDENT