Skip to main content
edited tags
Link
200_success
  • 144.2k
  • 22
  • 188
  • 473
edited tags; edited tags
Link
200_success
  • 144.2k
  • 22
  • 188
  • 473
deleted 15 characters in body
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

I'm trying to solve a programming challenge for fun. The programming challenge is here(http://uva.onlinejudge.org/external/100/10029.htmlhere) and my solution for the same can be found here).

My solution can be found below:It currently it causes aan exceeded time limit exceeded.

Instead of calculating the edit distance between strings  (using is_edit_distance_oneis_edit_distance_one) im, I'm generating a map with all possible edit strings of a string and checking if previous strings are present in it  (using the function "generate").

  • Are there any implementation level mistakes that I'm making thatsthat's slowing it down?
  • Any particular data structure I should/should not be using?
  • Any other algorithm I could use to speed things up?

I'm trying to solve a programming challenge for fun. The programming challenge is here(http://uva.onlinejudge.org/external/100/10029.html) and my solution for the same can be found here).

My solution can be found below: currently it causes a time limit exceeded.

Instead of calculating the edit distance between strings(using is_edit_distance_one) im generating a map with all possible edit strings of a string and checking if previous strings are present in it(using the function "generate").

  • Are there any implementation level mistakes that I'm making thats slowing it down?
  • Any particular data structure I should/should not be using?
  • Any other algorithm I could use to speed things up?

I'm trying to solve a programming challenge for fun. The programming challenge is here and my solution for the same can be found here.

It currently causes an exceeded time limit.

Instead of calculating the edit distance between strings  (using is_edit_distance_one), I'm generating a map with all possible edit strings of a string and checking if previous strings are present in it  (using the function "generate").

  • Are there any implementation level mistakes that I'm making that's slowing it down?
  • Any particular data structure I should/should not be using?
  • Any other algorithm I could use to speed things up?
Source Link
user32625
user32625
Loading