7 kyu
Kooka-Counter
1,192 of 3,573dinglemouse
Loading description...
Strings
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.
Lua translation!
Approved. Thanks.
I love this kata, made me apply a simple regex :)
Python fork
Approved!
This comment has been hidden.
Did this in
C
. So far, most of the katas I've completed by this author are apt challenges for beginners, but if you're into optimization and/or ninja-like brevity, you can also spend a lot more time working on a simple and elegant algorithm. It was incredibly satisfying noticing my solution was essentially the same as the author's. Love them! Keep at it, friend!:-)
Needs tests for all examples in the description: ha = female => 1 Ha = male => 1
Many solutions are wrong and do not work for a single "ha" / "Ha".
True. That depends on the language. What language are you referring to?
It was always intended that a single
Ha
orha
would work. Unfortunately some translations slipped through which did not check that.I could fix them, but like you sy, it would break many solutions, so I am not sure to do it or not...
JavaScript. You could also just update the description I guess, instead of changing the tests.
COBOL translation. Since the limit size for testcase message is 100 in COBOL, I can only print the raw string (without even quotes) to be sure it is displayed completely in all cases :)
Approved. Thanks!
Not as easy as i tought it would be.
Great kata! Once I understood what I was supposed to do it was smooth sailing. The description was a bit confusing and the test cases only made it more confusing. I had to peek at the Discourse to find what was expected.
I would highly recommend adding to the description that a bird may call out any number of "ha" or "Ha" in a row before the next bird calls out and no bird will call out more than once in each set.
The first is sort hinted at in the description but could be much more clear. The second is not at all addressed and also helps to further clarify the first.
I kind of wish there was another rating available of "COMPLETELY" in addition to the "VERY", "SOMEWHAT" and "NONE" options. I really am "VERY" satisfied with this kata but with a description update I would most certainly rate it "COMPLETELY" instead.
I've added some examples. Are you completely satisfied now?
"VERY"! LOL chef's kiss
C translation 🐦🦜🦜🐦
Note : the JavaScript version it was translated from has unit laughs of length 2 ("haha" or "HaHa"). This one is based on length 1 ("ha" or "Ha"), as I think you intended.
Approved, thanks!
Basic (at least) tests throw warnings:
fixed (
setup.c
is thePreloaded
section)Ruby 3.0 should be enabled.
fixed
The image in the description doesn't load.
https://i.pinimg.com/originals/9e/95/dd/9e95dd74d01330ca74f4c8d6c85ca7fc.jpg
Note the image is irrelevant to solve the kata tho.
Fixed. Thanks for reporting.
This comment has been hidden.
2fast
;-)
PHP Translation kumited! ;)
The kata says that 'HaHaHa' is male and 'hahaha' is female. Can someone please explain how 'HaHaHahahaHaHa' counts to 3? I'm definitely missing something.
There's not a fixed number of
Ha
orha
. (It says "..." in the description)So it's 3 because
HaHaHa
hahaHaHa
Since the '...' were after 3 repetitions I assumed that there must be at least 3. However I still don't get how "hahaHaHahahahahaHaHaHa" counts to 0. In fact what really confuses me is that all the random tests expect 0 as answer. I'm taling about the Ruby version.
Just tested it into Ruby and could not get a single 0 as an answer, actually...
The random tests I was talking about are below. Every test expects a 0. Don't know how it works for you and not for me.
Testing for "hahahahahahaHaHaHaHaHaHaHahahahahahahahahaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "HaHahahahahahaHaHahahahahaHaHaHaHaHaHaHahahahahahaha" It should work for random inputs too - Expected: 0, instead got: 6 Testing for "hahahahaHaHaHaHaHahahahahahahahahahahahaHaHahahahahahahahahaHaHaHaHahahahahaha" It should work for random inputs too - Expected: 0, instead got: 7 Testing for "HaHaHaHaHaHaHaHaHaHahaha" It should work for random inputs too - Expected: 0, instead got: 2 Testing for "HaHahahahahahahahahahahahaHaHaHaHahahahahahahahahahahahaha" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "hahahahahahahahaHaHaHaHaHaHaHaHaHaHaHaHaHaHahahahahahahahahahahaha" It should work for random inputs too - Expected: 0, instead got: 3 Testing for "HaHahahahahaHaHaHaHahahahahahahahahahahahahaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 5 Testing for "HaHaHaHaHaHaHaHahahaHaHaHaHaHahahaha" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "HaHaHaHaHaHaHahahahahaHaHa" It should work for random inputs too - Expected: 0, instead got: 3 Testing for "hahahahaHaHaHaHaHaHaHaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 2 Testing for "hahahahahahahahahaHaHaHaHaHaHaHahahaHaHaHaHaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "HaHaHaHaHaHaHaHaHaHahahahahahaHaHaHaHaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 3 Testing for "hahaHaHahahahahahaHaHaHahahahaHaHaHahahahaHaHaHaHaHahahahahahaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 10 Testing for "hahahahaHaHaHaHahahaHaHaHaHaHaHaHaHaHaHaHahahahahahahahaha" It should work for random inputs too - Expected: 0, instead got: 5 Testing for "HaHaHaHahahahahahahahaHaHahahahahahaHaHaHaHaHaHaHaHaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 5 Testing for "hahahahahahahahahahahahahahahahahahahahahahaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 2 Testing for "HaHaHaHaHaHaHaHaHaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 1 Testing for "hahahahahahaHaHahahahahahaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "HaHaHaHaHahahahahaHaHaHaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 3 Testing for "HaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHahahahaHaHaHaHahahahahahahahaha" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "HaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHahahahahaha" It should work for random inputs too - Expected: 0, instead got: 2 Testing for "HaHaHaHaHaHaHahahahahahahahahahahahahaHaHaHaHaHaHaHaHahahahahahahahahahaha" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "hahahaHaHaHahahahahahahahahahahahahahahahahahaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "hahahahahaHaHaHaHaHaHaHaHahahaha" It should work for random inputs too - Expected: 0, instead got: 3 Testing for "hahahahahahahaHaHahahahahahahaha" It should work for random inputs too - Expected: 0, instead got: 3 Testing for "HaHaHahahahahahaHaHaHaHaHaHaHaHahahaha" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "hahahahahahahahahahahahahahahaHaHahahahahaHaHaHaHaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "hahahahahahahaHaHaHaHaHaHaHaHaHaHahaha" It should work for random inputs too - Expected: 0, instead got: 3 Testing for "hahahahaHaHahahaHaHaHaHaHahahahahaHaHaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 6 Testing for "HaHaHaHaHaHaHaHaHaHahahahahaHaHaHaHaHaHaHaHahahahahaha" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "HaHaHaHaHaHaHaHaHaHaHahahahahaHaHaHaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 3 Testing for "hahahahahahahahahahahahahahahahahaHaHaHaHaHaHaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 2 Testing for "HaHaHaHaHaHaHaHaHaHaHaHaHaHahahahahahahahahaha" It should work for random inputs too - Expected: 0, instead got: 2 Testing for "HaHaHahahahaHaHaHaHaHahahahahahaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 5 Testing for "HaHaHaHaHahahahahaHaHaHaHaHaHaHaHaHaHaHaHaHaHahahahahaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 5 Testing for "hahahaHaHahahahahahaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "HaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHahahahahaHaHahahahahahahahaha" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "HaHaHahahahahahahahahahahahahahahahahaHaHaHahahahahahaHaHaHaHaHa" It should work for random inputs too - Expected: 0, instead got: 5 Testing for "HaHaHaHaHaHaHaHaHaHaHahahaHaHaHaHaHaHahahahaha" It should work for random inputs too - Expected: 0, instead got: 4 Testing for "hahahahahaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHahahahaHaHahahahaHaHaHahahahaha" It should work for random inputs too - Expected: 0, instead got: 7
Interesting; can you also pass me your code with a spoiler tag?
Your last question made me realize what was wrong with my code. I mutated the input string, which I usually wouldn't. Really sorry about wasting your time.
No worries, it is ok :)
I agree with Iron-Fingers, the description is misleading and leads to believe there must be at least 3 'ha' or 'Ha' elements in a row to count as a bird. This kata would be more easily understood if the description were changed to reflect that. However, I think the underlying challenge is fun. :-)
@jeffwright13. Thanks for the feedback. IMO the example test cases also contribute to the description instructions.
Yes they contribute, but they contribute in a confusing and unintuitive way. I suggest changing "HaHaHa" and "hahaha" in the description instructions to simply "Ha" and "ha"--wouldn't it be more clear that way?
Thanks for your suggestion.
Python, Ruby and Crystal translations submitted :)
@GiacomoSorbi
All approved. Thanks :-)@SteffenVogel_79
thanks for approval.:-)
HAHAHAhAhAhA strange bird ;-)