Magical Pascal


This is a companion discussion topic for the original entry at https://toph.co/p/magical-pascal

Any hint for this problem…i came with a solution which is for nth row but can’t find for first nth row

Hi Rashidul_du,

The main idea is to first solve how many odd numbers are there in the n-th row. The answer is 2^x, where x is the number of 1’s in the binary representation of n. You’ll need digit-dp to calculate how many odd numbers are there in the first n rows.

Hope this helps.

Yeah…but when the number is too big…I am getting CLE…even though I tried that approach