Maximum Score Hackerrank Solution C