counter game hackerrank solution