Sunday, April 10, 2016

HackerRank: string function calculation (II) - string algorithm - Boyer Moore Algorithm

April 10, 2016


  Problem statement:

https://www.hackerrank.com/challenges/string-function-calculation

  Time spent: 3:40pm - 4:40 pm

First hour work, score 8.9 out of 80 points. 
The solution: 
https://gist.github.com/jianminchen/09c77ba32b156f765b4debb2bccba0c8


Brute force solution:

pass one test case: aaaaaa, return 12,

use Boyer Moore Algorithm, still time out:

time spent: 8:00pm - 8:45pm 



copy Boyer Moore algorithm code from the webpage:

convert the class from Java to C#. 

Julia second try:  (time out issue - Boyer Moore Algorithm does not help!!!)




No comments:

Post a Comment