Implement greedy and beam decoding | Cresta Interview Question