Saturday, April 29, 2017

Maximal AND Subsequences - hackerrank world codesprint #10

April 29, 2017

Introduction


Problem statement is here.

It is the medium level algorithm, but Julia worked over 7 hours and she only managed to score 6 points out of 30 points. She tried a few time, scored from 3 point to 6 points. She was so hardworking and put together the test cases, and also make sure that her code is readable, function name and variable name are meaningful. She is waiting for inspiration to break through, still waiting...

Julia spent time to write a binary search algorithm, and she enjoyed the function to help her gain 6 points. What else she can do? World codesprint #10 is so tough, she now knows that people are so talent in the world. More than 5 players finished all seven algorithm in less than 2 hours, and the first 3 winners are finalized with $2000, $1500, $750 prize money.

It is very exciting contest and also it is most competitive contest compared to week code or others.

Show some progress and cheer up.


Here is the comparison Julia chose to compare with a Google employee.


Coding in contest 


Two test cases time out and also near 10 test cases wrong answers. Need to read the discussion board.

Follow up 

4/30/2017 9:36pm

After the contest, Julia published her code in the contest, link is here.

Need to download test case 6 and figure out why the code fails test case 6. In theory, the algorithm is exactly the same showing in editorial notes.

5/1 2017
Code after the contest - replace recursive binary search with an iterative one, pass test case 22, 23, score from 6 up to 7.14. 

Code is here

5/3/2017
Read code submission the_watcher and lewin, learn to write using bit manipulation. 

No comments:

Post a Comment