Update All and Retrieve Top K
Asked at Amazon · Coding Questions · Difficulty: Easy
Given a list `nums` and integer `k`, implement `update_nums()` which increments every element by 1, and `get_top_k()` which returns the current top `k` largest values in descending order.
Loading the problem…