A Kaprekar Number is a positive integer that, after being squared and split into two lexicographical parts, is equal to the sum of the two new numbers obtained:
Given a positive integer n implement a function that returns true if it's a Kaprekar number, and false if it's not.
is_kaprekar(3) ➞ false
# n² = "9"
# Left + Right = 0 + 9 = 9 ➞ 9 != 3
is_kaprekar(5) ➞ false
# n² = "25"
# Left + Right = 2 + 5 = 7 ➞ 7 != 5
is_kaprekar(297) ➞ true
# n² = "88209"
# Left + Right = 88 + 209 = 297 ➞ 297 == 297Trivially, 0 and 1 are Kaprekar Numbers being the only two numbers equal to their square. Any number formed only by digits equal to 9 will always be a Kaprekar Number.