Premium problem89. n Largest Values

Hard Locked

Return the n largest values of array Z, sorted ascending.

Input

Z = [3 1 4 1 5 9 2 6]
n = 3

Output

[5 6 9]

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)