DEV Community

Discussion on: I can't stop thinking in this coding problem

Collapse
terabytetiger profile image
Tyler V. (he/him)

I see what you mean.

If you do it that way, you aren't necessarily catching each driver once.

For example, if you have 4 cars and driver's with preferences of [8,7,5,1] the correct answer is 2, but because 8 is okay with cars 1,2 and 4, that method would return 3

Thread Thread
protium profile image
protium Author

You are right! I wasn't able some how to find the issue with that solution so I decided to post it here so I could sleep tonight haha. Thanks!