Given $n$ cards placed on a round table in upside down fashion, find the minimum operations to make them face upside up? I have $n$ cards which are placed on a round table such that $1$ is placed between $n$ and $2$ in upside down manner. I need to find minimum  number of operations to make them face upside up given that by flipping a card $i$ ,you also need to toggle the adjacent two cards.
For example-
Let $3$ cards are placed upside down on a round table such that $1$ is placed between $2$ and $3, 2$ is placed between $1$ and $3$ and $3$ is placed between $1$ and $2$. Now, if I flip card $1$, then both the adjacent cards ($2$ and $3$) will also toggle (if facing down, they will face upside up now or vice versa) and all the three will be facing upside up now.
My approach-
If n%3=0,then operations needed is n/3.
But i am not able to figure out what will be the minimum operations when n%3=1 or 2.
I have taken few examples and found out that for n=4,4 operations will be needed. For n=7,7 operations will be needed.
So,n operations will be needed for n cards when n%3=1 or 2.
But unfortunately,this is not the correct answer.
 A: $1$ is placed between $n$ and $2$, so I assume there are at least 3 cards.
I think $n$ operations are needed when $n \equiv 1 \mod 3$ or $n \equiv 2 \mod 3$.
It is never a good choice to pick the same card twice. You will just change the orientation of the card and the two adjacent cards two more times and nothing happens.
From every three subsequent cards at least one must be picked, otherwise the middle one will definitely stay faced down.
There are $n$ ways in which I can choose the triples. If we only picked one card from each triple, then $n$ times a card would be picked. However every card is in three triples and therefore the number of cards picked is $n/3$, a contradiction!
So there must be a triple in which more than one card was picked. The middle card must be flipped an odd number of times. Hence all three cards of the triple are picked.
We move the triple by one card at the time. Only one or three cards of the triple can be picked, so by induction we find that all cards on the table must be picked exactly once. 
