Showing posts with label woman codesprint #3. Show all posts
Showing posts with label woman codesprint #3. Show all posts

Sunday, March 12, 2017

Hackerrank - woman codesprint #3 - Hackathon shirts

March 12, 2017

Problem statement

C# code submission in the contest, score maximum score 40.

She spent a few hours on Hackathon Shirts. She thought about test cases she should choose more carefully. Two algorithms are involved, one is merging interval algorithm, the other is binary search algorithm. Very good workout.

Facts to share


Julia still made a bug in her writing after 4 - 5 times to practice merging intervals as an algorithm. Why? Because she depends on her memory of the algorithm, do not start from the beginning of analysis, what test cases she should cover when she finishes the coding. She missed the previous interval end value, she should check maximum of two values instead.

Julia,
rely on your past practices,
it is not to test how good your memorize the algorithm.
But always,
always start with 
the reasoning
test cases. 


Hackerrank - woman codesprint #3, elevator simulation

March 12, 2017

Problem statement

Contest performance 


Call it a day, 4:25am. Finally, after 4 hours writing code and dubugging, scored 18.00. Pass 7 test cases, fail 10 test cases. 8 runtime error, 2 wrong answers, Julia could not figure out and then she needs to go to sleep.

I never experienced this kind of coding, Elevator simulation, very good workout.

Julia, you should train yourself coding not in the contest. Julia enjoyed the adventure of coding this medium algorithm called elevator simulation. Julia could not believe that people can write the algorithm in less than one hour.

Here is the progress report, for the contest.


Follow up after the contest 


Here is the C# code submission in the contest.

Code Review of the function SimulationElevator


A few places have duplicate code, need to extra a new function for class WaitLine, Passenger, Trip, and then make the function SimulationElevator from 160 lines of code to less than 50 lines of code.

First revision 


April 3 2017
Julia spent over one hour to code review the submission on April 3 2017. The C# code is here. Plan to spend some time to review the design, try to pass all test cases. And then ask a code review on stackexchange.com.


Follow up 


March 14, 2018

I got an email about object-oriented design code review request from the peer in the morning 2:30 AM. so I gave some feedback. My main idea is to get into a community like hackerrank, and also being a hacker, and have some warrior spirit.

Here is my review.


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.

Hackerrank - Women's codesprint #3

March 11, 2017

Introduction


Julia learned the importance to go out more often, and she chose to go to the meetup called the tech & startup weekly in downtown, so she spent time from 6:30pm to 8:00pm to meet people. Actually she started to work on the contest around 9:00pm.

But she still made a lot of errors, and took more than 3 hours to code the first medium algorithm.

Here is the progress she made so far, 3/11/2017  12:46AM. She will go to sleep and then after a good night sleep, she will try to work on the other 2 medium algorithm and one hard algorithm.

She finished the first 3 algorithm and solved all of them successfully, score 70.00 so far.

Hackathon Shirts


She spent a few hours on Hackathon Shirts. She thought about test cases she should choose more carefully. Two algorithms are involved, one is merging interval algorithm, the other is binary search algorithm. Very good workout.

Facts to share


Julia still made a bug in her writing after 4 - 5 times to practice merging intervals as an algorithm. Why? Because she depends on her memory of the algorithm, do not start from the beginning of analysis, what test cases she should cover when she finishes the coding. She missed the previous interval end value, she should check maximum of two values instead.

Julia,
rely on your past practices,
it is not to test how good your memorize the algorithm.
But always,
always guard with 
test cases. 

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.

Canada Leaderboard 


Julia, you are ranking top 3 in Canada right now. March 11, 2017 6:12PM Pacific Time. Work hard!



Tennis pro player - Svetlana Kuznetsova 


Study one tennis pro a time -

Svetlana Kuznetsova

Pain does not kill me, I kill the pain. The tattoo came out before her knee surgery in 2012