Individual test cases pass correctly, but on submit it shows all of them as failed.
Whats wrong with my approach?
Please provide the link of your code
How do i do that? I don’t know how to share the code link.
Copy and paste your code in the above Coding Blocks IDE. Save it. And then send me the link.
did you get the link sarthak?
An Armstrong number is one which is equal to the sum of each of its digits raised to the power 3.
Example - 153 = (1^3) + (5^3) + (3^3)
Just check this condition simply and you don’t need two separate functions. This will only make the code more complex. Just make a single function.
No you are wrong. It is not always three. It is equal to the number of digits in the number.
Yes I know. But for the problem given on hackerblocks, take it as 3 only.
So it should be corrected then, I guess.
It still fails. I did powers of 3
No it doesn’t fail. Check out my code.
Did you check my code tho?
Still 2 tc fails for me…
Any thoughts on this? Even your code fails two test cases!
I guess test cases - 1 and 2 fails for both of us. Test case 1 is 406 and test case 2 is 370. Correct answers are false and true respectively which our code prints when run separately. So there is no error in the code. Its correct. There must be some error in the back end.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
Is the error resolved at backend now?
hi @Prashant-Kumar-1947183015386369 please try submitting your code now and let me know if the problem still persists. Also, in case it doesn’t work, please share the code you are using!