Sunday, April 10, 2016

HackerRank: string function calculation - string algorithm - Brute Force Solution

April 10, 2016

  Problem statement:

  Time spent: 2:40pm - 3:35pm 20 minutes to think, 20 minutes to write down in C#

Understand the problem, so, here are her thoughts:

Brute force solution:

pass one test case: aaaaaa, return 12,

failed test case:
wrong answer - Easy fix, index error on the loop

score 8.89/ 80

one test case: wrong answer
All other test cases time out

Need to work on KMP, or Boyer-Moore algorithm, see how to make HackerRank happy, score more points.


No comments:

Post a Comment