Wrong ans showing why

my logic is damn right why its showing wrong ans…

there are two possibilities -

  1. your logic is wrong
  2. your logic is correct but you didnt code it properly