Compute triangle min path and dice stopping stats | Agoda Interview Question