hackerrank : sherlock and squares