Plz see what is wrong in this code

refernce-

Hello @devwrath1999 could you please explain your logic?
i think you have shared some other code.
please confirm here.