You can view the solution by clicking on the solution tab.
Editorial
Need a hint? Checkout the editorial.
View Editorial
Editorial
For Part B, use induction and divide the last three rows into some parts.
A triangle of size $n$ is a collection of a number of circular coins which are placed in the shape of an equilateral triangle and there are $n$ coins along each side. For example, in the figure a triangle of size $5$ is shown. At first the Heads side of every coin is faced up. At a time, you can take three coins that are touching each other and flip their side.
Definition: Call flipping the sides of three coins that are touching each other a move. Alternating a triangle of size $n$ means flipping the sides of all the coins of that triangle by performing a series of moves.
A. Perform moves on the three corner triangles of size $1$ one by one and then perform a move on the center triangle of size $1$.
B. We prove this by induction. Base case $n=3$ is already shown. Now suppose we can alternate a triangle of size $n=3k$. We will show that we can also alternate the triangle of size $n=3(k+1)$. In this triangle, first alternate the top $3k$ part. Then, the remaining bottom three rows can be divided into parts like below:
There will be a triangle of size $1$ or $3$ at the end depending on whether $n$ is even or odd. Notice that all these parts can be alternated easily and we are done.
For Part B, use induction and divide the last three rows into some parts.