Find unique common element from 3 arrays

前端 未结 7 1578
故里飘歌
故里飘歌 2021-02-03 14:43

Original Problem:
I have 3 boxes each containing 200 coins, given that there is only one person who has made calls from all of the three boxes and thus the

相关标签:
7条回答
  • 2021-02-03 15:34

    If you sort all the arrays first O(n log n) then it will be pretty easy to find the common element in less than O(n^3) time. You can for example use binary search after sorting them.

    0 讨论(0)
提交回复
热议问题