Top 10! Leetcode Weekly Contest 184 (7th) with explanation and commentary

preview_player
Показать описание
Larry participates in the Leetcode Weekly Contest 184, finishing 7th out of 13661.

00:00 - Intro
00:49 - Contest Starts
00:55 - Larry works on the first problem
01:55 - Larry works on the second problem
06:42 - Larry works on the third problem
09:41 - Larry works on the fourth problem
15:52 - Larry successfully submits all problems
16:52 - Larry goes over the problem set

Retro - Really pretty much everything went right this contest - I could've been slightly faster, but I was definitely being careful and deliberate this contest. Can't really complain when you finish in the top ten!

Live commentary!

#leetcode #coding #python #programming
Рекомендации по теме
Комментарии
Автор

the 2nd question could be solved with a Fenwick tree which is O(nlogn)

saikaushik
Автор

Hey everybody, be sure to check the description for links to jump around different parts of the problem. Thanks for the support!

Algorithmist
Автор

Congrats on coming top 10 Larry! You were really awesome. 🥳

They missed out a test case for Q3 during the contest. There is an edge case where your solution using replace fails:
Input: “>”
Output: “>”
Expected: “>”
This is because using replace causes the following, “>” → “>” → “>” which as you can see is incorrect.

This edge case has now been added onto Q3 so you can try to solve it again :)

mohammedshoaib
Автор

Nice job on this contest, I agree, the first three were quite easy in that they could be brute forced without any optimization. The text replace function was a nice trick, I manually wrote that out using pointers and it slowed me down. The last one tripped me up, the DP approach now makes sense to me after you explained.

gillespie
Автор

You have to beat awice man. I believe in you.

twilightsucks