LAS decodes with beam search, keeping the best few partial transcripts at each step rather than the single best greedy choice. Pruning to the top scores is the step that keeps the search tractable.
Implement top_k_beams(scores, k), the indices of the k best hypotheses.
Sort the indices by descending score with a stable sort, then keep the first k.
No results yet
Run your code to check it against the examples, or submit to run every test.