simple problem from hackerrank