Draft
The most asked question on CodeWars
937 of 2,302Voile
Loading description...
Strings
Fundamentals
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.
The description states "You need to write a function detect that will check if a string STARTS WITH Can someone explain" but the random tests for JS are expecting the function to return true if "Can someone explain" appears anywhere in the string; not just at the start.
Not true:
Sorry; you're quite right!
This comment has been hidden.
Ruby 3.0 should be enabled, see this to learn how to do it
yeah
Kata sent back to draft for a long time ago.
As pointed out below, this is a duplicate of this kata.
sort of, but not exactly. I'll let this slide - but you can always start a new issue if you feel like this isn't a great decision
For Java (and this may apply to other languages too), there should really be an edge case that tests to see if someone used the
contains()
function since that returns true if it's anywhere in the String. Currently that works, and it shouldn't IMO. Just put an edge case function that puts "Can someone explain" somewhere else in the String other than the beginning.Thanks for the laugh - I thought I might see something creative in the top by clever list and was not disappointed.
Clojure Translation ready for review
Duplicate.
For real, this is easier version of that. So this is 8 kyu while that is 7 kyu
In Python you need to return True or False (the uppercase matters) :)
This comment has been hidden.
Why is this still in Beta?
Probably becauseSo more votes are required.Although with so many votes... How many 1 kyu votes are needed to get a kata stuck in beta forever?..No, actually, what's the threshold for approving a 7 kyu? 80%?
Yes, 80%.
The issues have to be resolved
Haskell : https://www.codewars.com/kumite/5b63739667557e4c8d00001b?sel=5b63739667557e4c8d00001b
You don't have a test for characters at the end of "Can someone explain" that aren't spaces, for example "Can someone explainable" may work in some people's code
This comment has been hidden.
@GiacomoSorbi
Added "Can someone explain" to the end ~half the time. Also added case sensitivity ('can someone explain' appears randomly), and a test for the suggestion above ("Can someone explainable", e.g. is invalid).
Add test
Test.assertEquals(detect("can someone explain to me"), false);
? I read the description wrong and wrote case insensitive one and passed :|Done.
@GiocomoSorbi for updating the other language versions :)
Thanks and congrats for 1 dan!
Thanks :D
Maybe randomly through the string
'Can someone explain'
into the middle or end of the input string, since you're only supposed to returntrue
if it appears in the beginning?Done!
My code should not pass. You marked the issue as resolved but I don't think it is. (Python)
I only fixed the JS version, for the translations you'll need to ask the translator for fixing them.
@GiacomoSorbi
Can someone explain you how to approve my Python, Ruby and Crystal translations :o?!
I think the Python version needs example tests :P
Also, sorry, I just updated the description before I can see your comment, so I think you'll need to solve the conflict first :)
Python fixed and all 3 solutions adapted; I will pretend not to hate you for the pain of forking them, plus I assume you should be able to see the forks even without a link, right?
All approved
Thanks :)
I see what you did there.