Capgemini interview question

coding for the leap year