Bill payment query sql hackerrank solution