Audible interview question

find nth largest element in an array

Interview Answer

Anonymous

24 Oct 2018

for i in 0.. arr[j+1] { let c = arr[j] arr[j] = arr[j+1] arr[j+1] = c } } } print(arr[n - 1])