Correct option is D
A bypass diode is used in series-connected solar panels to protect shaded cells from overheating and damage caused by reverse current flow. When a solar panel or a group of cells is shaded, it can become reverse-biased and start consuming power from other cells in the series. This can cause hotspots and damage the shaded cells.