1. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Nov 2012
Posts
7
Rep Power
0

#### Assassin game problem

Hi!!
Would anybody know how to solve this question?:

The game of Assassin is a simple game played on university campuses where each player is assigned a target to assassinate by simply saying “you’re dead” to them. Of course with thousands of people on campus and only a few dozen in the game you never know who is looking to assassinate you. Once you assassinate someone you take on the target they were looking for. If this happens to be you then you are the winner. To ensure that this works properly the targets must form a continuous “chain.” Write a program that allows the user to enter their target assignments and output whether it is valid or not based on if there is a continuous “chain.” Each person in the list is represented by position in the list. The value at the position is their target.
2. chase the indexes until you get to the start. If the length of this cycle is the length of the list the game is valid.

L = [1,2,0]
Start at index 0. Save index 0.
Look up L[0]. It is 1.
Is it 0?
No.