Showing posts with label Leetcode weekly contest. Show all posts
Showing posts with label Leetcode weekly contest. Show all posts

Saturday, September 15, 2018

Leetcode weekly contest 102

Sept. 15, 2018

Introduction


It is time for me to start to play contest again. I plan to play contest 102.

It takes me some time to understand the community to play contest. I like to learn and document my progress.


My performance


I wrote the first two algorithms, and then two solutions are accepted. I worked on the third algorithm and then worried about my time complexity O(N * N), N is the length of array; I thought that there is issue of timeout. I did not write the code, I still had more than 25 minutes. I did not come out O(N) solution for the third algorithm called 907. Sum of Subarray Minimums.

It turns out that the third algorithm will not time out the solution O(N * N), since I read the discuss after the contest.

I need to push myself hard. I need to take the chance. I like to show my ranking here.


After the contest


I spent more than 30 minutes to go over the lead board. I just could not believe that there are so many of them solve more than 500 algorithms on Leetcode.com. 

I have to figure out ways to solve another 100 algorithms first. 

Tuesday, June 20, 2017

Can Leetcode weekly contest make difference?

June 20, 2017

Introduction



It is a ritual to do small research every day. Today Julia chooses a topic called "Can Leetcode weekly contest make difference?"

The reason Julia chose the topic is that she found out her last leetcode weekly contest reminded her to work on the basics - linear scan array more efficiently. The blog is called Leetcode 605: Can place flowers.  Julia found a very short solution through Leetcode discussion after she spent 48 minutes in the contest, she learned to solve the problem using 5 minutes. Only 10% of time, she learned the basics of linear scan an array, looping first.

On June 19, Julia noticed that she performed better on mocking experience of algorithm Leetcode 151 compared to her last one more than one month ago.

The argument is that "Leetcode weekly contest makes difference".


Performance talk 


Leetcode.com is so helpful because it attracts million players to share ideas, compared to code review on stackexchange.com, Julia found out that Leetcode.com is a good place to find excellent ideas to solve a Leetcode algorithm, but codereviwe.stackexchange.com is an excellent place for Julia to practice good writing and learn how to share her learning. 




Saturday, June 3, 2017

Leetcode weekly contest 35

June 3, 2017

Introduction


It is a good practice to work on a contest this Saturday starting from 6:30 pm. Julia likes to play contest more often therefore she can figure out tips to be a great player.

Contest performance talk 



The first algorithm is called "Can Place Flowers". It took Julia almost 50 minutes to pass the online judge. First Julia tried to use recursive function and then she figured out it was too much work after 20 minutes. And then she chose to use iterative solution, but it took her another 20 minutes to fix bugs in her writing.

The second algorithm is called "Construct string from binary tree". It took Julia only 20 minutes to write the solution and she passed the online judge.

The third algorithm is called "Find Duplicate File in System", Julia only had 20 minutes, she wrote the code but she could not finish in 20 minutes. After the contest, she just wrote another 5 minutes, she could not believe that the code was easy to work on as well.

So the performance of her third weekly contest is here.



Plan to work on hard algorithm in the contest called "Tag validator".

Saturday, April 8, 2017

Leetcode weekly contest 27

April 8, 2017

Plan to play leetcode weekly contest at 6:30 pm. 90 minutes contest.

First time to join the contest.

In 90 minutes, Julia finished first two algorithms, but second one she came int runtime error.

Her C# code in the contest is here. Need to work on more on this medium algorithm, Leetcode 554.

Actionable Item


3 medium algorithm, each takes 20 minutes. So, the code should be less than 50 lines for each algorithm.

Time just flies too quickly when Julia worked on Leetcode 554. She managed to work out the sample test case, but it does not pass Leetcode online judge.

Analysis of Leetcode 554


Julia, you should think about using min heap to track line sweep algorithm, therefore no run time error, which is probably timeout.

Julia's Argument - 2 cents after her first contest 


Leetcode has more fast pace to develop new algorithm and bring into a lot of players compared to Hackerrank, therefore 2017 Julia should spend more time to play with Leetcode algorithm.