Wednesday, March 2, 2016

HackerRank: HourRank 6

March 2, 2016

Introduction 

  Problems statement: Lisa's work book.

  Julia spent more than 1 hour to work on first question on HackerRank: HourRank 6, Lisa's workbook.

  It's a one-hour rated contest with 3-4 algorithmic challenges. Are you fast and accurate enough to win it? 

  So, by any means, Julia finished the first algorithm, and passed all test cases. 20 minutes to read the question, and then, 20 minutes to write, and over 20 minutes to debug, fix bugs to pass basic test case. 


   Here is the code she wrote:

Julia's C# practice in the contest. 
  

   So, she read other people's code. Best performers in top 20 use less than 5 minutes. 


Code study 


  Julia read a few of great code to use loops. So, she now has more ideas to implement the algorithm. 

  Her favorite ones:

  No. 1 (#6):  

 Code study No. 1, code is here
       

 No. 2 (#12):

 Code study No. 2, code is here
   

 No. 3  Julia's favorite solution -

 Code study No. 3, code is here.
 


Actionable items



   1. Work on basics - for loops; Julia, learn from others - basic C programming, it is quick and fast. 

   2. C++, less time to write compared to C#. 

  3. A lot of room to improve, 
60 minutes -> 20 minutes, <- reading time from 20 -> 5 minutes
20 minutes to 10 minutes,  <- clean code, no bug
20 minutes to 5 minutes. 

   4. It is like the sports. Julia, you have to practice. 

Some workout:
No. 1 (#6):  
    Code study, link is here.
 

Add some comments to the solution:

No. 2 (#12)


Study code is here


Julia added some comment besides the code.   



No. 3

study code is here

Julia added some comment besides the code. 







No comments:

Post a Comment