57. 100 Soldiers are standing in a circle Puzzle | Logic | Solution | Python Code

Опубликовано: 07 Ноябрь 2023
на канале: Sirialgorithms
165
6

Hi Viewers,
In this video i am explaining the logic and writing python code to solve 100 soldiers.
Problem Statement:
100 soldiers are standing in a circle and first person having sword. The first kills to his next and handover the sword to that next person, the process continues to the one soldier remain. Now we need to investigate the survived soldier number. Solution: I explained the logic and wrote the python code.

Key learnings:
1. Understand the problem statements
2. steps to solve any problem
3. Formulate the solution approach
4. Execute & conclude Important point in 3rd iteration: python lists are linear, at 3rd iteration poped 1st soldier to make these soldiers in to circle.

Enjoy the learning, you can also write your versions in the comment box below.
Thanks
Sireesha (sirialgorithms)