I am facing this problem while solving multiple problems.
My code works for the sample input and I get the correct output, but when I go to submit my code, it gives me a ‘wrong answer’ message.
I usually code my answers based on the sample input and output. Should I change my coding perspective?
Let me know what you think.