Problem statement is here.
Julia's C# practice is here.
Why it took 48 minutes?
It is a good idea to review the process to get the correct solution, after a few submissions. Through the contest, Julia spent time to play with online judge, she submitted code more than 3 times, failed to pass the test case before submission. She failed twice with two submissions.
Here are the code with highlights of bugs Julia spent more time she could afford in the contest. To improve her performance, she should aim to complete the easy algorithm in 10 minutes instead of 48 minutes.
Preparation is the key
The idea is to go over 4 places she highlighted her mistakes in the first writing. How she introduced the bugs in her analysis.
What are missing to help her to develop the correct code?
She will study a little more and figure out what to make her coding speed up. Learn to use white boarding test, do not back and forth using online judge to correct logic thinking flaws.
Julia likes to change her style in coding. Do not rely on online judge, write a bug-free code using white boarding testing. But she should have done it early and then she starts to build up experience.
Spend at least 5 minutes in the contest to set up a few of test cases, and also calculate the answer. Use those test cases to help the design, understand the problem first.
1 0 0 0 0 1 => answer to plant flower is 1 => 1 0 1 0 0 1
0 0 0 0 1 => answer to plant flower is 2 => 1 0 1 0 1
1 0 0 0 0 => answer to plant flower is 2 => 1 0 1 0 1
1 0 0 1 0 0 0 1 => answer to plant flower is 1 => 1 0 0 1 0 1 0 1
Study the discussion
Unbelievable clear and short code. It only takes 5 minutes to complete the code.
No comments:
Post a Comment