This repository would be a documentation of my journey towards learning Data structures and algorithms. Please :star: this repo if you liked the effort :smile:
Problem:
A dice with numbers 1 to 6 is rolled 100 times. A person is climbing stairs as per these rules:
If number 1 or 2 comes, he steps down by 1 step
If number 3, 4 or 5 comes, he steps up by 1 step
If 6 comes, he rolls again and steps up by the number shown on the dice
There is less than 1% chance that he may fall and begins from 0 again.
Find the % of chance of him reaching above step 60 after 100 rolls
Solution:
Ideally, it requires infinite iterations as test data, but we take 50,000 iterations max so that it runs easily. User can decide number of iterations upto 50,000 and run the program to find out the percentage
Problem: A dice with numbers 1 to 6 is rolled 100 times. A person is climbing stairs as per these rules:
Find the % of chance of him reaching above step 60 after 100 rolls
Solution: Ideally, it requires infinite iterations as test data, but we take 50,000 iterations max so that it runs easily. User can decide number of iterations upto 50,000 and run the program to find out the percentage