Saturday, March 11, 2017

Hackerrank - Woman Codesprint #3 - Choosing recipes

March 11, 2017

Introduction

Problem statement

Julia spent over 3 hours to work on this medium algorithm, she finally figured out the challenge after 3 hours labor, and then she took this greedy approach only score 29 points out of maximum score 50.

Now it is 5:44pm, March 11, 2017. She has a few choices, continue to work on this algorithm, or move to next medium algorithm, and the last algorithm which is hard one.

Let us get some progress report here.


Choosing Recipes


Work on the Choosing Recipes algorithm starting from 11:30am - 4:13pm, very close to a workable solution.  It just took more than 3 hours to figure out the ingredient purchase only need counting once.

Once Julia knows the tough part of the algorithm, she took greedy approach and used recursive solution to make a quick points first, she made it 29 points, her algorithm passed first 7 test cases but failed test cases from 8 to 12.

Julia scored 29 points out of maximum score 50, at 5:49pm. There are still 14 hours to go, actually she has 6 hours before 12:00am. She has to make decision to continue on this algorithm, or move to next medium algorithm, last hard algorithm.


C# code review after the contest


Here is the C# code submission in the contest. 

Read the comment above the function of ChoosingRecipesMinimuCostGreedyApproach, "This algorithm is designed to take greedy approach, it will not guarantee the minimum cost for all n dishes". Julia did not aim for perfect solution, dynamic programming solution is still hard for her to figure out in the contest.

Need to look into how to improve reading skills. Julia did not notice the sentence impact on the algorithm correctness, read it slowly, think about how to catch it in first 1 - 2 reading. "she must purchase it at the supermarket; however, once she has an ingredient, she can use it in an infinite number of recipes." Julia did not pay enough attention to this statement and what it means for the correctness of the algorithm. She found out this after 3 hours working, it was too late but she was lucky to know to look for something important in the problem statement. There must be a good way to write down important things, good at coding should also be based on the good reading skills. Julia likes to put this more urgent issue to solve in short term.

Julia took 3 times IELTS tests in 2009 from June to August, but she did not have chance to train herself on reading skills from 2009 to 2017. Julia did some urgent patches to the problem in 2009, and the issue is still floating up after 8 years and catch her attention in more painful way.

Will do some research on ideas how to improve reading, specifically technical reading.

No comments:

Post a Comment