You are viewing a single comment's thread. Return to all comments →
Shows wrong answer for some of test cases,Can anyone help?
n = 0 for i in range(k): a = arr.index(max(arr[n:])) if arr[a] != arr[n]: arr[a], arr[n] = arr[n], arr[a] n = n+1 else: n = n+1 return arr
Largest Permutation
You are viewing a single comment's thread. Return to all comments →
Shows wrong answer for some of test cases,Can anyone help?