Nov. 20, 2016
One thing Julia is learning in the contest is to write simple code, avoid complicated situation, cut the executable paths/ giant expression/ complicated things to eat time.
One thing Julia likes to do is to compare her C# solution using Dictionary<Int64, string> to this C++ solution, she just found out that her logic thinking can be simpler.
C# solution written by Julia:
https://gist.github.com/jianminchen/af474846d81b96f4e70fc1a5866dca15
C++ solution: (rank after 400 before 500)
https://gist.github.com/jianminchen/0e98727e40937c11594b0be8ea496885
Compared to top performer (rank 6 out of 1500) - C++ code, just less than 30 lines of code:
https://gist.github.com/jianminchen/8a448bac7de8ad3667b125abe3544e5d
Very close to my idea in C# - by a Microsoft Bing employee -
Nickolas - Topcoder writer, rank 84 of contest.
https://gist.github.com/jianminchen/7ef0dcb49662f277fda36742da5fa57c
Study all her submission on this contest ! - figure out the style I should learn.
Julia's comment:
Know the problem inside out, a lot of ideas and implementation. One day, Julia can choose best one to make it less than 10 minutes a medium algorithm as well.
Visual facts to encourage Julia work hard, and continuously improve! The goal is to shorten the time to performance. It is also practical goal, achievable!
Here is the graph Julia likes to share the research she did through the contest:
Case 1:
algorithm: minimum cost
100 minutes vs 8 minutes - over 10 times more to spend on the performance! Julia, you have a big room to improve!
Case 2:
algorithm: stone division, revisited
329 minutes to come out a solution, score 0 of 50; extra 3 hour to work until 2:00am
Compared to 50 minutes full performance, less than 40 minutes.
500 minutes -> 40 minutes, 10 times more! I just could not believe that. The research and development I did over 6 hours, does not help. Best performer uses 40 minutes to do everything, including his research, coding and testing etc.
From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one. 2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会. She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going. Hard work beats talent when talent fails to work hard.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment