Company: Nokia_8march
Difficulty: medium
Determine Armstrong Problem Description A number X is an Armstrong number if it is the sum of N th powers of its digits where N = the number of digits present in X. You are given a number X. If it is Armstrong print YES otherwise print NO. Function Description Complete the function solve() . This function takes the following parameter and returns the required answer. X : Represents the value of X Input Format for Custom Testing Note: Use this input format if you are testing against custom input or writing code in a language where we don't provide boilerplate code The first line contains T, which represents the number of test cases. For each test case The first line contains a single integer X denoting the value of X Output Format For each test case, print a single line containing the answer. Examples Example 1: Input: 2 153 321 Output: YES NO Explanation: The first testcase (X = 153) is an Armstrong number because it is the sum of its digits raised to the power of the number of digits.