Wrongful compilation

My answer seems to be correct and matches with solution video and dry runned it myself too but the results do not match on compilation. Please check