A language model writes two-word sentences. first_chances[i] is the chance it starts with first word i, and second_chances[i][j] is the chance that next word j follows it. Write best_sentence(first_chances, second_chances): return [i, j], the most likely sentence of all.
| the | a |
|---|---|
| 0.6 | 0.4 |
| cat | dog | sun | end | |
|---|---|---|---|---|
| the | 0.3 | 0.25 | 0.25 | 0.2 |
| a | 0.05 | 0.9 | 0.03 | 0.02 |