Showing:
Handle Score
@Ibrahim Nash 6564
@mb1973 5785
@Quandray 5275
@akhayrutdinov 5111
@saiujwal13083 5074
@kirtidee18 4639
@sanjay05 3762
@mantu_singh 3712
@gfgaccount 3627
@marius_valentin_dragoi 3525
Basic Accuracy: 36.57% Submissions: 93 Points: 1

Given a number N, write a program to check whether given number is Adam Number or not.
Adam number is a number when reversed, the square of the number and the square of the reversed number should be numbers which are reverse of each other.

Example 1:

Input:
N = 12
Output:
YES
Explanation:
122 = 144 and 212 = 441. 144 reversed
gives 441, So, it's an Adam Number.

Example 1:

Input:
N = 12
Output:
YES
Explanation:
142 = 196. 196 reversed gives 691,
which isn't equal to 412 So,
it's not an Adam Number.

You don't need to read input or print anything. Your task is to complete the function checkAdamOrNot() which takes an Integer N as input and returns the answer as "YES" if it is a Ada, number. Otherwise, returns "NO".

Expected Time Complexity: O(|N|)
Expected Auxiliary Space: O(1)

Constraints:
1 <= N <= 104