Python Programming Practice: LeetCode #169 -- Majority Element

preview_player
Показать описание
In this episode of Python Programming Practice: LeetCode #169 -- Majority Element

Link to the problem here:

Python Programming Practice is a series focused on teaching practical coding skills by solving exercises on popular coding websites. Note that the solutions seen here may not be the most efficient possible.

I am not going to provide the full code in the video description for this series, since copy and pasting solutions is not in the spirit of doing coding exercises. It is intended that the video will help you think about problems, approaches and how to structure solutions so that you are able to code up a working solution yourself. .

Рекомендации по теме
Комментарии
Автор

Thank you for this video. But for your last (one line solution) how it will work in case there is no majority element? It will return just some random number I suppose. We should have one more iteration over elements to count majority.

ocamlmail