Showing posts with label Week of code 34. Show all posts
Showing posts with label Week of code 34. Show all posts

Monday, July 24, 2017

Maximum Gcd and Sum (III)

July 24, 2017

Introduction


"Maximum Gcd and Sum" is the algorithm related to great common divisor, and prime number technique called sieve of eratosthenes is used in the optimal solution.

The algorithm is the first medium level algorithm in week of code 34 on Hackerrank. Julia spent more than a few hour in the Saturday of July 21, she did not come out the solution to fix the timeout and run time error issue.

Here is the optimal solution after the study of editorial notes.

Plan to do time complexity analysis on test case 1, 400,000 is the length of testing array.


Week of code 34 (II)

July 24, 2017

It is early in the morning 12:09 am. The contest just ended 9 minutes ago. Julia spent a few hours this Sunday from 6 pm to 12 am to work on the contest, but she did not score anything. She did not write any code either.

Sunday went away fast. Julia got up around 9:30 am, and spent one hour to work on the contest, and then she left home around 11:20 am for church service. She came back to home with friends to prepare lunch around 2: 30 pm, and then had good time until 5:30 pm.

It was really hard to work on the algorithm. Julia felt a little sleep around 6:00 pm, and then she spent one hour to talk over the phone.

Julia likes to work on those algorithm next week and catch up more on training. Stay positive.




Sunday, July 23, 2017

Path Statistics

July 23, 2017

Plan to work on the algorithm called Path Statistics which is expert level algorithm in the week of code 34. The problem statement is here.

Now it is 11:28 pm, 32 minutes before the contest ends.

Julia likes to write some code for this algorithm, and see if she has any chance to score anything.


Magic Cards

July 23, 2017

It is the first expert level algorithm in the week of code 34 on hackerrank.com. Julia likes to read the problem statement and spend 30 minutes to work on the problem first.

Here is the problem statement.

Now it is 6:27 pm, the contest will end in less than 6 hours.

Julia likes to read every algorithm in the contest. It is hard for her to work on the algorithm in such a short time.


Recurrent on a tree

July 23, 2017

It is the hard level algorithm in week of code 34, hackerrank contest. It is 5:24 pm July 23, 2017. Julia plans to read the problem statement in 30 minutes, and do some research on the algorithm in a hour.

The problem statement is here.

Saturday, July 22, 2017

Same occurrence

July 22, 2017

It is the second medium level algorithm in Hackerrank week of code 34. Right now, Julia has to start the algorithm and try to make some progress. It is 10:17 pm. Julia likes the challenge.

Plan to study Leetcode contiguous subarray related algorithms first.

Plan to work on Leetcode 53 (easy) and Leetcode 152 (medium level) first.


Maximum Gcd and Sum (II)

July 22, 2017

It takes a lot of time to move forward with timeout issue on this algorithm. Julia likes to check her progress and stay positive all the time.

Here is her code submission in second time, now it is 8:00 pm, 7/22/2017.




The original points for the algorithm is 25, but so far only 16.4 available for Saturday player. Julia only made 20% of available points 16.4. Continue to work on it!

It is 10:27 pm. Julia worked on timeout issues, now she came cross runtime error issue. Most of her issues are runtime error, only two cases are timeout.



Follow up after the contest


July 24, 2017

The code submitted in the contest is here. The idea used in the algorithm is to find prime factors for each number in the array.


Maximum Gcd and Sum

July 22, 2017

Plan to work on the medium level algorithm called "Maximum Gcd and Sum".

Analysis and investment of time


It is running late for Julia to work on week of code contest. Julia read all discussions and this medium algorithm only has single digit successful rate after a few days.

Julia likes to do some research to help herself to solve the problem. She could not afford to spend a few hours without gaining some new skills.

She decides to work on a few related algorithm first.

First one is called "Efficient program to print all prime factors of a given number".

Plan to read the topcoder article called "Prime numbers, factorization and Euler function".


Wednesday, July 19, 2017

Week of Code 34

July 19, 2017

Introduction


It is time to play a hackerrank contest again called "Week of Code 34".

Passion is gone



Julia got her first gold medal in the week of code 33 because she worked hard on the contest.

Now it is time for another week contest, but Julia was too busy in weekdays, she did not have time to work on any algorithm. Another thing she missed is her passion for the contest. Passion is so easy to go away, Julia was busy first two days in the week to review coding practice last 3 months, and the rest 3 days after work, she played tennis Wednesday, and Thursday she rested and Friday she worked on other algorithms.