jamesmurdza revised this gist . Go to revision
1 file changed, 5 insertions
gistfile1.txt(file created)
@@ -0,0 +1,5 @@ | |||
1 | + | if k == 0: | |
2 | + | return [] | |
3 | + | arr.sort() | |
4 | + | ans = arr[-k:] | |
5 | + | return ans |
Newer
Older