Maximum Score Hackerrank Problem