Company: Goldman Sachs OA
Difficulty: medium
Leap Frogs In the \"Leap Frogs\" game, n green frogs are positioned on one side of a set of 2n+1 lily pads (as shown in figure with n=3), while n yellow frogs are on the other side. The objective is to swap the positions of the green and yellow frogs. Frogs can move to an empty lily pad if it is directly next to them, or they can jump over another frog if there is an empty pad on the other side of the frog being jumped over. Additionally, when the game ends, no two frogs of the same color should end up adjacent to each other. Write a program to find the minimum number of moves required to successfully interchange the positions of the frogs. Input Format The input contains an integer \'n\' that denotes the number of frogs on each side. Output Format The output must display the minimum number of moves required to successfully interchange the position of the frogs. Constraints 1 ≤ n ≤ 1000 - The number of frogs on each side ranges from 1 to 1000. A frog changing its position from one pad