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
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!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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
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!