breaking the records hackerrank solution