The answer is correct but showing wrong while submitting

everything mentioned in the topic itself

please share the code in cb ide