Doubt in cses dice combination question

https://cses.fi/problemset/task/1633
please say how to solve this question in top down approach