Hello and welcome. "My solution is different from the usual one" is not a problem, per se. Have you tried running your code with various inputs? Are the outputs correct? If not, then please ask about that.
↧