You are viewing a single comment's thread. Return to all comments →
why not the other number be taken?
Total number of routes from T1 to Tn modulo 1234567"
The problem says to output mod 1234567. That is where that number comes from.
but he didnt clearly mention that we have to take mod of each value
taking mod at each value helps in keeping the product in the range of 1234567 so computation will be easy.
concept is (a*b*c) mod 1234567==
(a mod 1234567) * (b mod 1234567) * (c mod 1234567)