Revolut interview question

Perfect Squares (available on leetcode)