Wednesday, December 28, 2016

HackerRank week code 27 - Hackonacci Matrix Rotations

Dec. 28, 2016

Problem statement

Score 4 - Maximum score: 40

Julia C# practice

Julia had great time to practice matrix rotations, she spent over 2+ hours to work on rotation details.

Timeout is a biggest issue. Most of top players got tip from HackerRank email to use matrix manipulation called ?.

Read editorial notes, please.

Time spent in the contest:

2+ hours

Study Google employee's code

So simple, it will take less than 20 minutes to write and read:
C++

C++

Study facebook employee code:

1. Code looks like Julia's, so Julia will study more on this implementation: Rank 40 (7000+ players)

https://www.hackerrank.com/maxvv

Java 8

Study Amazon employee's code:

Java

Important!! Study the above code, Julia, you do not need to rotate the matrix, just compare each pair of numbers:
Java Code to study

line 24 - 36.

Stanford university:

Java 7


Lesson learned:

Hackerrank sent out an email for the tip - use matrix exponentiation, top players used the tips and also if Julia checked the discussion session, top 500 players were discussing the matrix exponentiation as well. 

Julia has to pay attention to detail, go through the discussions and involve discussion as well. 

From score 4 to 40, it takes some research, and change the design of algorithm accordingly.

Follow up after 3 months


March 8, 2017
1. Read blogs written by a facebook scientist:
blogs about algorithms

   Study one scientist a time, figure out what I can learn from his experience. Ginseppe M. Mazzeo

2. Understand the algorithm, post is on code review.

No comments:

Post a Comment