I used trial division and it was too slow, but then i looked for other factors in my code to improve the execution time, and was able to greatly reduce the excecution time. As a somewhat spoiler free hint, i thnk that memoization was a big factor for making it, mine in particular, faster.
between 100 and 110 we have 101, 103, 107, 109 but 101-107 is not a 6-gap because there is 103 in between and 103-109 is not a 6-gap because there is 107 in between.
In Haskell there is an issue with the test case that has gap = 6, m = 100, n = 110. Test's expected value is Nothing but is wrong since the right answer is (101,107). Can you fix it?
Sample Tests pass but the Attempt fails with a 12000ms time out mentioning algorithm efficiency problems. My prime algorithm uses the trial division primality test. Are we expected to use a more sophisticated algorithm like the Miller-Rabin primality tests for this kata?
this part where it says, (the following chars: ".,:;-?! '()$%&" and the '"'-char)....does the last part mean, " symbol as in double qoutation mark for the last char in the region of chars?
The description does not explain the kata well. parameter n is not even described or mentioned aside for the function parameter decleration...when writing kata's software develpment practices should be a given.
if i try a higher ranked kyu challenge and the test output show that the "actual" matches the "expected" results exactly but the tests still fail, who do I ask for help as I cannot post on a higher kyu challenge?
I used trial division and it was too slow, but then i looked for other factors in my code to improve the execution time, and was able to greatly reduce the excecution time. As a somewhat spoiler free hint, i thnk that memoization was a big factor for making it, mine in particular, faster.
so basically you want to look at your prime algorithms efficiency? perhaps its not efficient when searching if a number is prime or not.
I have the same issue. But how to optimize the code? I've tryied, but can not pass the test.
I would disagree. This question is not that hard imo as no special algorithms/data structures are really required.
optimized my code and everything passes. kata's should mention time complexity in the description.
This kata's description should mention algorithm efficiency, e.g. Time complexity Big O for example....
Nothing to fix:
The test is ok.
In Haskell there is an issue with the test case that has gap = 6, m = 100, n = 110. Test's expected value is Nothing but is wrong since the right answer is (101,107). Can you fix it?
Sample Tests pass but the Attempt fails with a 12000ms time out mentioning algorithm efficiency problems. My prime algorithm uses the trial division primality test. Are we expected to use a more sophisticated algorithm like the Miller-Rabin primality tests for this kata?
nevermind found my issue.
greetings,
this part where it says, (the following chars: ".,:;-?! '()$%&" and the '"'-char)....does the last part mean, " symbol as in double qoutation mark for the last char in the region of chars?
yes, saw the "Do this n times!" I think its still vague, e.g. what does doing it n times give? e.g. if I run it 100 times vs 10?
It's there ^
The description does not explain the kata well. parameter n is not even described or mentioned aside for the function parameter decleration...when writing kata's software develpment practices should be a given.
if i try a higher ranked kyu challenge and the test output show that the "actual" matches the "expected" results exactly but the tests still fail, who do I ask for help as I cannot post on a higher kyu challenge?
Loading more items...