Is My Logic correct or Not? and resolve the error

You forgot to use return statement in insert function in if else cases

can you correct my code with comment

I’ll end up writing too much code
It’s better if you write the return statements yourself
I’ll help you out after you’ve edited the code if needed

Hello @jatinkumarjk2001 you have raised the doubt again is there any problem you are still facing?
could you please elaborate so that i can help you in the better way.

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.