6 kyu
String Suffixes
504 of 1,247debri
Loading description...
Strings
Logic
Arrays
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Python update (new testing framework)
Approved
It's a good kata. But it have to have a more clearer description, that suffixes are calculated based on the word and not static. In my case I've understood that the example values are static. So I've lost the solution thread and gave up on the task.
What do you think?
This comment has been hidden.
In JS: My code is working fine for test cases, but when I attempt it, in random cases, first it failed for 7 cases, then 4, then 6, then 3. IDK why its fluctuating like this. Even for the failed random case, the next time its showing passed. My code is fine, anything wrong with random tests?
it fluctuates because random tests are well, random, and because your code is not fine, it has a logical flaw. try it with e.g.
"abcazc"
C translation (author gone)
Approved
COBOL translation + description unified (author is inactive).
.
JS: Node v14 should be used along with its appropiate assertion tools (Mocha + Chai). Refer to this and this
Updated to Node v14
Ruby 3.0 should be enabled, see this to learn how to do it
Enabled in this fork
Python 3 should be enabled.
Done.
I am new here. I am trying to solve this problem. When i run test, my code is success for all input . But when i submit my code. It shows following message Expected: 3, instead got: undefined Expected: 3, instead got: undefined Expected: 11, instead got: undefined Expected: 10, instead got: undefined Expected: 15, instead got: undefined Expected: 21, instead got: undefined Expected: 8, instead got: undefined Expected: 5, instead got: undefined Expected: 1, instead got: undefined Expected: 8, instead got: undefined
I hope my code is ok but problem in submiting code. What is the standard way to submit code?
Looks like you gave up. (Answer is
return
, BTW.)There is no explaination for the final tests. Why would random inputs work differently?
Testing for idirywskioiisbslqsdpjzbxxy It should work for random inputs too: 35 should equal 30
You had better think again. I had same problem.
Point
I like it! I would definitely suggest changing the description to make it more apparent that only prefixes be matched. Initially I was scratching my head wondering why the following was 0 similarity instead of 1:
abacaa bacaa
Otherwise, nice kata, thanks!
Grear Kata!!! twas relaxing
In explanation it says "for second string", what second string is he referring to ?
For this problem, the first string is the input string and the second string is represented by the suffixes of the first string, subsequently.
I've got a problem with this kata in JS: For an explantation I refer to the given kata example.
a b a b a a
a b a b a a --> 6 hits (that's ok, this isn't the problem...)
a b a b a a
b a b a a --> should be 0, but why? this is matching. it should be 1, shouldn't it?
...length of the longest prefix common to both strings....
I was also caught out like that initially.
Thanks, bro. This was the hint I needed!
In the JS verion, it would be nice if you would add a description to your final tests. Otherwise theres no feedback as to why any of the final tests are failing.
eg: Test.assertEquals(stringSuffix('ababaa'),12, "ababaa");
Looks fixed.
Translations submitted, JS version integrated with some more testing :)
For python again that error should be merge first
No problem at all: try now with the forked (most recent) version and let me know if it works :)
Any progress? Can you approve it, now :)?