educative.io

Educative

Author's code is wrong

While author indicates it should not be duplicates in the last searches, his code does.

Hi Ulises,

The code seems working fine for me. Can you please give it a check again, or can you please elaborate on the problem again?

Thank you!

I think there is a discrepancy between how the task is stated vs what the solution is actually doing. The task makes it sound like should be no duplicates whatsoever displayed. In the solution, however, the task supposedly was to avoid consecutive duplicates. So the solution does what it’s supposed to do, but the task got switched.