0
For something I'm working on, I need a function that takes in a one-dimensional array vec of integers and returns a boolean array of the same shape indicating where the n largest entries of vec are located.
For example,
nlargest([0, 1, 3, 5], 2) should yield [0, 0, 1, 1].
nlargest([0, 0, 4, 0, 3...