Given a number N. Check if it is a Kaprekar number or not. Note:- A Kaprekar number is a number whose square when divided into two parts the sum of those parts is equal to the original number and none of the parts has value 0. Now given a number, your task is to check if it is Kaprekar number or not.
45*45=2025. Now, 20+25=45.
Thus, 45 is a kaprekar number.
20*20=400.There is no way to divide
400 into two parts such that their sum is equal
to 20.So, 20 is not a kaprekar number.
You don't need to read input or print anything.Your Task is to complete the function isKaprekar() which takes the number N as input parameter and returns 1 if N is a kaprekar number.Otherwise, it returns 0.
Expected Time Complexity:O(LogN) Expected Auxillary Space:O(1)