Sunday, November 20, 2016

Woman's CodeSprint 2 - Minimum Loss - after the contest (series 2 of 10)

Nov. 20, 2016


Julia worked on the algorithm in the contest, and then solved the algorithm with full score - 35.

Here is the problem statement:

Julia's C# solution:


The ideas used in the algorithm:

Use bucket sort similar idea to go through each bucket, compare to previous if the current is less than minimum loss 
or not. Each bucket keeps the two value - max/ min value.

Study all other submissions using C++, Java, C#, JavaScript:

Actionable Items:

1. Read the code line by line, word by word; train myself to understand the code, by reading, by association 
with C#.

2. Study TreeSet - Java - class - memorize all the API, compared to C# Hashset
https://docs.oracle.com/javase/7/docs/api/java/util/TreeSet.html

My favorite Java code:
https://gist.github.com/jianminchen/3fce12eff5838fa10bff0792547d0779

A small research - TreeSet in Java is implemented as Binary search Tree?
http://stackoverflow.com/questions/4430809/making-binary-search-tree

Find the best solution written in Java:

Discussion of Time Complexity:

1. Brute force solution - O(n^2), choose any two year to compare the price. Will time-out!

2. Using Binary search - therefore, it is easy to find the minimum price, O(nlogn)
Maintain a binary search tree!

Study this C# solution using Binary search tree:

https://gist.github.com/jianminchen/c910f5d1f37309c70b489e6c75b0678c

line 16, 25 are Julia's favorite code - 


Very classical solution using binary search tree, and very clever solution.

Memorize the solution. Warm up the solution sometimes in the future.


Woman's CodeSprint 2 - Minimum Loss - in the contest (series 1 of 10)

Nov. 20, 2016

Julia worked on the algorithm in the contest, and then solved the algorithm with full score - 35.

Here is the problem statement:
https://www.hackerrank.com/contests/womens-codesprint-2/challenges/minimum-loss

Julia's C# solution:

https://gist.github.com/jianminchen/af474846d81b96f4e70fc1a5866dca15

The ideas used in the algorithm:

Sort the array with house price.

Use bucket sort similar idea to go through each bucket, compare to previous if the current is less than minimum loss or not. Each bucket keeps the two value - max/ min value.

After the contest study:

There is a solution written in C#, much simpler and smarter than Julia's C# code:

https://gist.github.com/jianminchen/c382bc1b40e47c2740a25abcaeffb846

Based on the assumption that housing price is different for each year, but I did not find the word in the problem statement.

Discussion of Time Complexity:

1. Brute force solution - O(n^2), choose any two year to compare the price. Will time-out!

2. Using Binary search - therefore, it is easy to find the minimum price, O(nlogn)
Maintain a binary search tree!

Study this C# solution using Binary search tree:

https://gist.github.com/jianminchen/c910f5d1f37309c70b489e6c75b0678c

Very classical solution using binary search tree, and very clever solution.

Memorize the solution. Warm up the solution sometimes in the future.

Compared to Java submission using TreeSet class:
https://gist.github.com/jianminchen/6fa69ef28c849d63ed0dc4b419cd0dee


3.


Saturday, November 19, 2016

HackerRank - university codesprint - array construction - code study (series 4 of 5)

Nov. 19, 2016

Plan to spend time to study all 211 submission score 80 -

Array Construction

https://www.hackerrank.com/contests/university-codesprint/challenges/array-construction/leaderboard/3

6 Java/ 8 Java8/ 60 cpp/ 2 C#

Also, study code scored 40 or above 40.

Also, read more code if time is available. Most important is to find ideas solving problems.

Ideas Julia likes most:

ideas about DFS, backtracking, DP, and pruning ideas related to mathematics, algebra. 


1. DP - dynamic programming
See Editorial notes of Array construction
2. ...


Blogs:

https://yourstory.com/2015/11/simran-dokania/

coding blog:  Java

http://problemasdeprogramacao.blogspot.com


Friday, November 18, 2016

HackerRank - university codesprint - array construction - testing and playing after the contest (series 3 of 5)

Nov. 18, 2016

Julia spent another 3+ hours to work on the array construction code study after she understood the algorithm design.  The blog:

http://juliachencoding.blogspot.ca/2016/11/hackerrank-codesprint-array.html

Here is the C# solution she did some research:

1. perfect solution with full score 80
https://gist.github.com/jianminchen/096ebc5bc1769b83b38ec6eeaabbc7c5

And then, she wrote some debug information on the code:

debug code:
C# code with debug info (stage II):

So, she tried to figure out if she can apply the same idea to her code in the contest, but she still had timeout issues. And then, she noticed that line 36 of solution: 
https://gist.github.com/jianminchen/096ebc5bc1769b83b38ec6eeaabbc7c5

--
line 6:
static bool[, ,] w;

line 21:
w = new bool[n, s + 1, k + 1];

line 36:
if (w[p, sum, diffsum]) return -1; else w[p, sum, diffsum] = true;
--

- quick calculation to verify the space limit - 
n<= 50,
s<=200
k<=2000,
so, bool[,,]w size is less than 20 MB.
HackerRank contest space limit is 512MB. It is ok to declare the w[,,] 3 dimension array to avoid timeout!
-- the end of space limit calculation --


She tried to play with line 36, comment out the line 36, run HackerRank test cases, and then, she found out that test case 4 timeout.

Testing and new findings:

1. first, she commented out the code on line 36:
https://gist.github.com/jianminchen/096ebc5bc1769b83b38ec6eeaabbc7c5

and then, HackerRank complained test case 4 timeout.
So, this pruning is important to avoid timeout.

So, she open the test case 4 input:

20
50 200 1860
...

Julia chose first test case by mistake: 50, 20, 1860 instead of 50, 200, 1860, trace file is 193 page long in the word document.

Fact: 50, 200, 1860, out-of-memory, trace file is too big

Julia ran the debug code to get trace:
debug code:
C# code with debug info (stage II):

And then, here is the trace information - 

TraceFile No 1:
https://gist.github.com/jianminchen/2d3622a096c51b0afe81fd60ca9865ef

Open the trace file(TraceFile No 1) using github,

Search the word: w[49,6,282],
Find first, line 4661,
w[p, sum, diffsum] is not true w[49,6,282]

Read content from line 4658 - 4661:

line 4658:
E: Array A is [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,3,3,9]

line 4659:
F: recursive call construct - arguments: (A,6,282,49)

We know that before the small sequence is found, then, w[49,6,282] is called again. We knew that
the first call W[49,6,282] is calculated and did not lead to a solution. So the second time, we
stopped right away.

Search again on w[49,6,282]
See the line 6722:
E: Array A is [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,1,1,4,15]

see the line 6723:
F: recursive call construct - arguments: (A,6,282,49)

see the line 6725:
w[p, sum, diffsum] is true - w[49,6,282] - return -1

In other words, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,3,3]
(A, 6, 282, 49) is the first time to invoke W[49,6,282], and then, continue to run the code,
did not find the optimal solution.
So the second time, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,1,1,4]
(A, 6, 282, 49)
w[p, sum, diffsum] is true, return -1.


Julia's notes:

HackerRank advanced algorithm "Array Construction" is really a challenging one. But Julia likes to
have some fun with the algorithm, and then, she just played the algorithm, C# study code, and then,
her own code. Try to find something interesting.





Wednesday, November 16, 2016

HackerRank - university codesprint - kindergarten adventures (after the contest)

Nov. 16, 2016

It is time to learn Segment Tree quickly. Julia worked on Segment Tree a few times in 2016, but when she worked on the algorithm in the contest, she did not come out the idea using segment tree to solve the problem. Segment tree is also called binary index tree.

The best learning experience is a failure. She will remember forever how segment tree is applied to a real story - kindergarten adventures.

Problem statement

Previous blogs about segment tree:

1. Oct. 18, 2016
Segment Tree Tutorial

2. Sept. 25, 2016
Range Minimum Query blog

3. March 4, 2016
HackerRank: Bear and Steady Gene (I)

Study C# submissions:

1. C# code # 1
2. C# code #2
3. C# code #3
4. C# code #4
5. C# code #5

Study JavaScript submission

Study Java submission

There are over 60 solution to score 30 (maximum score 30), go over one by one, and learn a few tips from those solutions. Write down what you like most - 3 things in Java code.

1. Very structured code

2. Java code to study

No. 1
No. 2
No. 3

C solution

Julia's ideas to improve the performance:

1. Try to write some code first, or do some research to categorize the problem, narrow down the algorithm problem - segment tree. (Quickly go over competition books, search ideas!)

2. Either improving the research of categorizing the problem to classical problem, or be practical, using brute force solution to get a few points. (Just do it!)

3. Give up the effort on advanced algorithm, only focus on one of medium algorithms. If Julia work on this medium algorithm in the contest, put 10 hours work on it, then she could score full score. (Aim low target first!)

4. Try to get in Bronze medal first. Work on medium algorithm (maximum score 30) instead of advanced algorithm (maximum score 80). (Play safe! From medium to advanced)

5. Try to work on an algorithm in 2 hours range - Do not spend more than 2 hours on a problem. First work on medium algorithm each one 2 hours first. Increase the chance to score more points.





Learning style - a good tip to share

Nov. 16, 2016

One of daily habit is to look up search keywords through Blogger back office.

Here are the last month search keywords of this blog:
hackerrank bonetrousle
leetcode 146 C#
acm cheat sheet
leetcode 239
topcoder + finding the longest increasing ...
zig-zag traversal of a binary tree in c
camelcase hackerrank solution
pluralsight c++ advanced

Nov. 16, 2016 - one of search from Yahoo.com is about this algorithm:

http://juliachencoding.blogspot.ca/2016/04/hackerrank-connected-cell-in-grid.html


Julia's favorite algorithm - DFS/ BFS algorithm, she did a lot of practice from April - June, 2016. Five months later, it is time to review the algorithm again.

--

So, Julia will refresh the content of those blogs as well, and try to improve the solution/ or blog content as well.

Share the blog statistics of month of November, 2016:




How to prepare for a programming interview?

Nov. 16, 2016

Read the blog, and write down some notes for further research:

http://snip.ly/0aey0?platform=hootsuite#http://www.makeuseof.com/tag/prepare-programming-interview/

Julia's idea - compete the high level, stressful, challenging contest one contest a time, and then try to find the weakness, improve one algorithm a time, find ways to be a better competitive programmer.

Julia likes to challenge herself in sports training last few years. She just got used to do a lot of competitions through the tennis sports, she knew that she had so many failures, uncountable, but also she learned day by day, got very confident on the sports. She worked on tennis sports - on court close to 500 hours last 5 years, watching tennis games/ coaching videos etc. over 200 hours.

So, she tried to apply her tennis sports experience to her personal coding experience as well. Also she is working on her writing skills - blogging is part of her practice, contribution to the IT community, get connected to most talent people in the world.

Nov. 24, 2016
1. https://blogs.msdn.microsoft.com/ericlippert/2004/04/15/writing-code-on-whiteboards-is-hard/

2. http://sellsbrothers.com/tagged/interview

Monday, November 14, 2016

HackerRank codesprint - Array construction - after contest (series 2 of 5)

Nov. 14, 2016

Problem statement:
https://www.hackerrank.com/contests/university-codesprint/challenges/array-construction/submissions/code/7825209


Study C# submissions:
1. perfect solution with full score 80
https://gist.github.com/jianminchen/096ebc5bc1769b83b38ec6eeaabbc7c5

Julia spent more than one hour to read code, but she could not understand the design. So, she decided to work on debugging, add output text info to figure out the design.

Here are workout she did and then figured out the algorithm:

Study more than 2 hours on one of solutions, using recursive solution; but Julia still are not clear about the solution. Need to work on more! Do not give up! Try it every day 10 minutes. It should be easy! 


Julia's work (3+ hours) Try very hard to understand the clever solution by debugging 

-  From the above C# solution:
https://gist.github.com/jianminchen/096ebc5bc1769b83b38ec6eeaabbc7c5

-->   add some debug information to understand the algorithm 

add debugging information to the source code 


-> Here is the log file to understand the algorithm design:

Question 1:
Use your own words to guess how to design the algorithm through debugging process?

Answer:

still confused about line 118, line 119:

118  int newSum     = sum + i * (n - p);

119  int newDiffSum = diffsum + (i * p - sum) * (n - p);

Question 2: What does (n-p) stand for? Can you explain it in one sentence?

Let us work on one more change first:


so, decided to track n-p value on line 118.
C# code with debug info (stage II):


Actionable Items:

1. Run test cases, and compare the time difference 
First, comment out code on line 36, time out on test case 4.

Write a new blog on this testing adventure.
http://juliachencoding.blogspot.ca/2016/11/hackerrank-university-codesprint-array_18.html


2. Study all C# solutions:

2.1. perfect solution with full score 80

2.2. perfect solution with full score 80

2.3. score half score 40

3. understand one term: constructive algorithm
Constructive algorithm: (preprocessing, and then, lookup)
(HackerRank - array construction is a constructive algo.)

Great idea to push hard - cannot get it wrong! that is the attitude for advanced level algorithm involved mathematical analyse.

Sunday, November 13, 2016

HackerRank - university codesprint - Walking the longest path (Approximation problem)

Nov. 13, 2016

Problem statement:

https://www.hackerrank.com/contests/university-codesprint/challenges

Will come back very soon to write down some notes. Julia spent over one hour to read the problem statement.

blog reading:
1. http://snip.ly/0aey0?platform=hootsuite#http://www.makeuseof.com/tag/prepare-programming-interview/

2. Top 10 ranking - HackerRank university codesprint 2016
http://blog.csdn.net/philipsweng

Ranking 46: high school student - a lot of good articles in Chinese
http://blog.csdn.net/a_crazy_czy


HackerRank - university codesprint - Bob and Ben (thinking in the contest)

Nov. 13, 2016

Problem statement:

https://www.hackerrank.com/contests/university-codesprint/challenges/bob-and-ben


Julia worked on the algorithm, she read the problem statement and then write down her analysis. She will come back to write down some work she did in the contest.

No coding, she read the problem statement and ensured that she did understand the problem.

Will come back later to write down some notes.

HackerRank - university codesprint - kindergarten adventures (in the contest)

Nov. 13, 2016

Problem statement:

https://www.hackerrank.com/contests/university-codesprint/challenges/kindergarten-adventures

Julia spent over 1 hour to read problem statement, and worked on ideas to solve the problem on Nov. 11, 2016. She will write down her analysis later.




HackerRank - University CodeSprint - Array Construction - In contest performance (series 1 of 5)

Nov. 13, 2016

Problem statement:
https://www.hackerrank.com/contests/university-codesprint/challenges/array-construction/submissions/code/7825209

Advanced algorithm, Max Score: 80

Over 6 hours to work on the algorithm.

Warm up the topic:
It felt so good to work on the algorithm.

First, Julia warmed up the backtracking algorithm using sample test case, spent more than one hour.
input:
1
3 3 4
output:
0 1 2
Here is the submission: pass the above test case, score 0.
https://gist.github.com/jianminchen/c17ce782080a99a2480ff1c6eb390628

There are a lot of issues, timeout, wrong answer. As long as the solution used the backtracking, DFS with some pruning, the timeout issue could not be avoided. Julia worked up to 3:30am, more than 10 hours, 5 hours before the end of contest. She finally gave up the effort and called it a day.

Julia felt so challenged through the problem solving, she went through backtracking, timeout issue, and then, she did some pruning, set up maximum/ minimum range for the search, through sum of array and sum of difference of any two elements. She did some research after over 10 hours, and then, find the article to reduce O(n^2) to O(n) to calculate sum of (Ai-Aj) for any i, j from 1 to n.

Highlights of great things in the contest: (need to fill out with really good things, think hard again.)
1. First, Julia did search from smallest word to biggest one.
This way, if she finds one word, the word should be the smallest one. Backtracking algorithm she did practice on phone number.

2. Julia had backtracking code experience, on Leetcode phone number.

3. Although Julia did not know DFS/backtracking could not solve the timeout issue, she knew that backtracking practice helps her to understand the problem, really understand the scalability issue. She understands the depth of the problem, and also understand the math analysis of time complexity is such important to help design.

4.
5.
6.

Highlights of things to work on:
1. Backtracking algorithm cannot beat the dynamic programming algorithm on timeout issue.
DP solution can give the math formula about time complexity analysis, and then, further pruning gives out better performance.

10 hours hard word, learn the first lesson.

2.
3.
4.
5.
6.


Last submission: score 8 of 80
Julia spent over 20 minutes to clean up the code, reduce the complexity of the code through so many efforts, hours work. Just use common sense, "The real challenge is from mathematics! What is time complexity of my algorithm? I had to depend on those pruning ideas - it worked great on my test case, up to 50 (size of array)(line 101 - 119), only take around 110 milliseconds, but it still failed on timeout issue."

https://gist.github.com/jianminchen/42300e1f09b748d5a165990f0c7f64b2

Study C# submissions:

1. perfect solution with full score 80

https://gist.github.com/jianminchen/49f45acc69b4d87c51d02c81a788fbc9

2. perfect solution with full score 80

https://gist.github.com/jianminchen/096ebc5bc1769b83b38ec6eeaabbc7c5

3. score half score 40

https://gist.github.com/jianminchen/f85de0c2b6014ff79d1097ce12705691

Constructive algorithm: (preprocessing, and then, lookup)
(HackerRank - array construction is a constructive algo.)
https://www.quora.com/What-does-the-constructive-algorithms-tag-mean-at-Codeforces

University CodeSprint: Hackerland Radio Transmitters (after the contest)

Nov. 13, 2016

Problem statement:

https://www.hackerrank.com/contests/university-codesprint/challenges/hackerland-radio-transmitters

Solution using two pointers:

https://gist.github.com/jianminchen/c5204568cc43b05489eb87afc77fbfd8

University CodeSprint: Hackerland Radio Transmitters (in the contest)

Nov. 13, 2016

problem statement:

https://www.hackerrank.com/contests/university-codesprint/challenges/hackerland-radio-transmitters

Submission in the contest:   score 6 of 16

https://gist.github.com/jianminchen/8b7822488dbf607ef187da2cb46e146c

Actionable Items:

This is an easy algorithm.

Failed test case 2:

7   2
2   4  5  6   9  12  15

Actionable Item:

Work on more testing, just be more patient. And careful write down how many test cases will pass.

Mobile first

Nov. 13, 2016

Julia has to focus on learning mobile first design again. She went back to work on the book:

Luke Wroblewski - Mobile first

Spent 1 hour to read the book on Nov. 10.

Spent 2 hour to go over twitter account content on Nov. 10: Julia's favorite!
https://twitter.com/lukew


And then, she watched latest videos:
Luke Wroblewski Part 1 - Conversions@Google 2016
https://www.youtube.com/watch?v=OkeJg92PA4E&t=1380s

Luke Wroblewski Part 2 - Conversions@Google 2016
https://www.youtube.com/watch?v=1jUaGin7YTM&spfreload=5




Tuesday, November 8, 2016

How stackoverflow works?

Nov. 8, 2016 - January 25, 2017
Introduction
It is a long journey for Julia to get updated with latest technologies. She laughed about it when she went to meet people from companies, she heard a term called "reinvent yourself". How she could do better through this process. She stopped to attend the events like speed dating format to meet employers, she knew that she had to catch up, and she did not cover the basic questions very well. Do you use a source control system? How do you test a pen?

Those days are long gone. Work alone as a development team. But Julia has one. She has to take chance to develop all skills she likes to have through the years.

Julia knows that only way she can get better is to make current employer happy - by her favorite career coach Kevin O'Leary. No wonder Julia had to write logs for every day activities, and then find her weakness by her own, and then catch up.

So, she started to question about stackoverflow.com, watched 5 or 6 videos from Joel, and played Joe's videos again and again when she worked out at her living room, and then one day she heard that Joe shared his personal story, how he wrote blogs and then so lonely, after 5 or 6 years, but one day he had this idea like stackoverflow.com. From blog writing to the idea of stackoverflow, Joel gave credit for his small habit to write blogs.

Humble to do a small thing every day. That is the way to get chance to be the best.

Log of study:

1. The Interview, Joel Spolsky, CEO, Stack Overflow

2. Do some research on "Stackoverflow vote up/ down, moderator, credit, etc. "

Watch more videos, another one is here.

Talk about performance review, how to manage software developers etc.

3. Make Better Software: The Training Series - Module 2: Team Members

Dec. 11, 2016

 (watched 3 times - my cooking time video - Dec. 10 - Dec. 15)

Joel Spolsky at TechHub

Dec. 15, 2016

Joel Spolsky @Hive53.com


Actionable Items on Nov. 8, 2016:

1. Spent time to write a biographer on stackoverflow.com for myself. Take time to write something to build a brand.

My profile is here.
My profile on code review is here.
My profile on softwareengineering.stackexchange.com is here.








Resume screen - study of resume

Nov. 8, 2016

Resume screening
https://www.youtube.com/watch?v=ChWXDnzIB00

PBCES

P  - passion
B  - Brands - high GPA
C - creativity
E -
S - Screening - selective universities etc.

Work on resume screen tips through Google search:

1. Read article:
https://www.facebook.com/notes/facebook-engineering/get-that-job-at-facebook/10150964382448920/

2.
http://steve-yegge.blogspot.ca/2008/03/get-that-job-at-google.html

1. Study a data-structures and algorithms book

Julia's favorite advice:
to practice the art of recognizing that certain problem classes are best solved with certain algorithms and data structures

Mental Prep

Go in humble, open-minded, and focused. 

Don't try to change the subject and answer a different question. 
Don't try to divert the interviewer from asking you a question by telling war stories. 
Don't try to bluff your interviewer. 

You should focus on each problem they're giving you and make your best effort to answer it fully.

Even if you think you know the answer to the problem, ask some questions and talk about the approach you'll take a little before diving in.

Do not come across as arrogant, people will question whether they want to work with you.

The best way to appear arrogant is to question the validity of the interviewer's question – it really ticks them off, as I pointed out earlier on.

Treat every question as legitimate, even if you are frustrated that you don't know the answer.

Feel free to ask for help or hints if you're stuck.

Do not take too long before actually solving the problem, or some interviewers will give you a delay-of-game penalty.

Try to move and write quickly, since often the interviewers want to get through more than one question during the interview.

They will mark you down because they could not get a full picture of your skills.

The benefit of the doubt is rarely given in interviewing.

Operating System:
Doug Lea's Concurrent Programming in Java
(lots of other books on concurrency. I'd avoid the academic ones and focus on the practical stuff, since it's most likely to get asked in interviews.)




HackerRank - matrix rotation (Series 4 of 5)

Nov. 8, 2016

Plan to work on unfinished HackerRank algorithm related to array, try to score full score this time to celebrate new year 2017.

http://juliachencoding.blogspot.ca/2016/04/hackerrank-matrix-rotation-ii.html

Rotate array - HackerRank

problem statement:
https://www.hackerrank.com/challenges/matrix-rotation-algo

Write C# solution:

Review April, 2016 practice: 

another practice: (more than 1 hour, still having bugs, score 8.89/ wrong answer)
https://gist.github.com/jianminchen/57572227dafe939060f7cc81b193cd9b

Will come back very soon with the solution, hopefully score a hard algorithm perfectly. 

Dec. 6, 2016
Fix the bug on line 114, declare a new variable on line 114 actualSteps
C# solution - pass all test cases:
https://gist.github.com/jianminchen/6fabef7436097552e35633a549b0268a

There are over 100 C# solutions, Julia, let us have some fun; code review as many solutions as possible. 
Post C# solution here:

Monday, November 7, 2016

HackerRank NCR codesprint review

Nov. 7, 2016

Codesprint:
https://www.hackerrank.com/contests/ncr-codesprint/challenges


Julia was so motivated to spend 2 days in the weekend to work on the codesprint, she only did one shopping trip to Burnaby crystal mall, less than 2 hours. Rest of weekend, she worked on the problem solving.

Julia reviewed the article about HackerRank contest and how to play better:

https://goo.gl/IHeEoi

Her favorite note in the above blog, item 4:

Even if you are not world class competitive programmer, you still have a chance to get into top 50 or even higher. The minimum goal is to get into top100, which is like usually about top 2–3% of all competitors. Being in top100 is great and sounds really good. 

The major factor to achieve the goal is a combination of problem solving skills, online research, dedication and persistence. First read all the problems and start solving them one by one from the easiest one. First solve the ones you can tackle without any research or long thinking, just to mark them as done and get motivation to tackle harder ones.

Julia did some research on this NCR contest, in top 100, even around 100, some of them are ICPC contest winner, score range is around 200 out of 430. 

Julia's score is 62.76, 480 out of 2621. 

Facts:
1. Julia likes to work on those hard algorithms, last 3 of 8 algorithms. She thought that she could make 10 from each of them. But it was too late when she read the problem statement. She only had 3 hour left to 12:00am in the middle night of Sunday. 

Lessons learned: 

Do not work on ideas taking a lot of time to code; even prototype is questionable. Treat it as a contest, play to win, not play to learn. 

48 hours contest, a lot of algorithms - 8 of them, total time to work on is 16 hours, 8 hours a day. So, give each algorithm 2 hours a time. 

Spent 6-8 hours to score 6 out of 20 on spiral message. Simple mistake of understanding problem statement, and base test case: one line, one row failure. 

Should be more confident on hard algorithm - game of numbers. Less than 1 hour to score 15 of 50, but gave up bug fix. So close to perfect solution. 
So, if Julia has more experience to play HackerRank contest, she should try to make it at least 100 of 430. And also, she can spend less hours to work on the contest, and spend 1 - 2 hours a day on sport activities in the day time. 

Do not think about past contest - Warlmart codesprint, 24 hour contest, Julia spent time to bet on a hard problem (score: 100) until 4:00am, and scored 0 of 100. 





HackerRank NCR codesprint - super-valid bracket sequences (II - first submission)

Nov. 7, 2016

Problem statement:

https://www.hackerrank.com/contests/ncr-codesprint/challenges/super-valid-bracket-sequences

First submission: pass sample test case, score 0 of 40.

https://gist.github.com/jianminchen/c4cfa2a7a4ffeecaaeff725af17baaad


Julia spent time to understand the problem, and then, she did work on sample test case; and next, she likes to work on timeout, space complexity.

It is a dynamic programming solution.

HackerRank NCR codespring - super-valid bracket sequences (I - prototype)

Nov. 7, 2016

Problem statement:

https://www.hackerrank.com/contests/ncr-codesprint/challenges/super-valid-bracket-sequences

Julia spent over 2 hours to do some research, work on a simple problem using code, figure out the size T(n), and also came out the formula of recurrence.

Here is her code for prototype work:

https://gist.github.com/jianminchen/d27a0c1b5d7b366903b4c25408d25269

HackerRank NCR codesprint - Game of Numbers

Nov. 7, 2016

Problem statement:

https://www.hackerrank.com/contests/ncr-codesprint/challenges/game-of-numbers


Her first submission:  score 15 of 50
https://gist.github.com/jianminchen/ef96b59d7279f1b80473519434ab959f

In the 48 hour contest, second day evening around 9:00pm, she could not believe that she could make 15 of 50 so easy so quick.

Celebrated her work by showing her workout sheet.


Editorial Notes:

Julia did not know how she is so close to perfect solution; she only need to minimize the module size to 11 for her test case, start left = 1, end right = 11, instead of 21 she figured out in her workout sheet.

She did not notice that her work needs to be examined carefully. Hard problem can be completed in 10 - 30 minutes, Julia spent over 4 years to study applied mathematics in SJTU, she just did not practice a lot at all in last 6 years. She is very comfortable with discrete mathematics.



HackerRank NCR codesprint - Mega Tic-Tac-Toe

Nov. 7, 2016

Problem statement:
https://www.hackerrank.com/contests/ncr-codesprint/challenges/mega-tic-tac-toe

Submission using Dynamic Programming solution, score 30 out of 30.


https://gist.github.com/jianminchen/0055d61e696ef762310f1176734b2d60