Find an element in hash with minimum index value
res_ind = sys . maxsize NEW_LINE res = 0 NEW_LINE for x , y in hash . items ( ) : NEW_LINE INDENT if y < res_ind : NEW_LINE INDENT res_ind = y NEW_LINE res = x NEW_LINE DEDENT DEDENT return res NEW_LINE