Last ant on rod ( NPTEL week 3 Assignment 3 Solution)

There are 'n' ants on a 'n+1' length rod. The ants are numbered from 1 to n and are initially placed at positions starting from position 1 till position n. They are moving either in left direction (denoted by '-1') or in the right direction (denoted by '1'). Whenever an ant crosses the boundary of the rod … Continue reading Last ant on rod ( NPTEL week 3 Assignment 3 Solution)