Third Maximum Number | LeetCode 414 | Coding Interview Tutorial

preview_player
Показать описание
Third Maximum Number solution: LeetCode 414

CORRECTION: In the whiteboard section of this video, I incorrectly stated that the third maximum number in [1, 11 -4, 0, 1, 5] is 0. It should actually be 1. I missed the last step. Sorry about that!

AFFILIATE LINKS
If you're interested in learning algorithms, these are great resources.

💲 All coupons and discounts 💲

Third Maximum Number | LeetCode 414 | Coding Interview
#thirdmaximumnumber #leetcode #algorithms #terriblewhiteboard #codinginterview

Click the time stamp to jump to different parts of the video.
00:00 Title
00:06 Problem readout
01:18 Whiteboard solution
04:04 Coding solution
10:35 Result and outro
Рекомендации по теме
Комментарии
Автор

CORRECTION: In the whiteboard section of this video, I incorrectly stated that the third maximum number in [1, 11 -4, 0, 1, 5] is 0. It should actually be 1. I missed the last step. Sorry about that!

Also, if there are any videos you'd like me to make or if you have any ideas on how to optimize this solution, let me know!

TerribleWhiteboard
Автор

Best explanation on youtube for this particular approach. Thanks for the great work and please continue to make these videos!

robertsedgewick
Автор

Why the third max =0 not 1 if we have array [1, 11, -4, 0, 1, 5 ]

oxana
Автор

Why the for loop starts at zero, why doesn't it starts at 1? We already assigned the first element in the array to firstMax or max.

yogeshmeshram
Автор

Hi, In the array [2, 2, 3, 1] the 3rd max is 1 and not 2 as the 2s are not unique but for the array [1, 2, 2, 5, 3, 5] the 3rd max is 2 and not 3 even if the 2s are not unique. Could you please explain this?

VIKASKUMARHBK
Автор

can anyone give me same solution in JAVA

prathameshTBSM
visit shbcf.ru