Can someone explain it line by line for me as a beginner
Like what does the N do? Why is there 3 shells but only 2 are accounted for and the “3rd” one is just the guess? If it’s supposed to be seeing if the guess is write why does it not ask “if g = pebble shell location” or something like that?
The first line of the input file contains an integer N giving the number of swaps (1≤N≤1001≤�≤100). Each of the next N� lines describes a step of the game and contains three integers a�, b�, and g�, indicating that shells a� and b� were swapped by Bessie, and then Elsie guessed shell g� after the swap was made. All three of these integers are either 1, 2, or 3, and a≠b�≠�.
Basically its saying that theres three shells, and each line of input tells you: (pos1) swapped with(pos2) → (guess 1); because theres only 3 shells and bessie swapped two and elsie made a guess, and the first line N just indicates how many swaps and guesses there were
The first input is the number of swaps so it says 3 and we have 3 swaps:
1 2 1
3 2 1
1 3 1
Each line represents swap a, b, and guess. Shells 1 and 2 were swapped and the guess was 1. Shell 3 and 2 were swapped and the guess was 1 again. Shell 1 and 3 were swapped and same guess.
The N or first input tells you how many times you should iterate the input really