LeetCode 1198. Find Smallest Common Element in All Rows | JSer - JavaScript & Algorithm

preview_player
Показать описание
For multiple array problems, first think about how to solve the simplest case of 2, and then try to deduct the general approach for n arrays.

Usually there would be a priority queue solution, but sometimes there is more simple and cleverer way.

Hi I'm a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode & BFE.dev. If you are interested, maybe we can learn together.
Рекомендации по теме
Комментарии
Автор

is it O(mn) or O(m+n) for the first two arrays?

PankajKumar