Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
No random tests
Added this (plus some other perfomance tests) to all languages: many (most?) of the existing solutions were wiped out...
Negative numbers are not tested.
Just added a test case similar to that mentioned by you.
Just added test cases similar to those mentioned by you (Ruby version pending fixes).
Edit: Now ok.
Just added.
Just added a test case similar to that mentioned by you.
I'd disagree. It took me a bit to understand it, but when it clicked, it made me smile. I think that's what clever solutions are about.
Of course, it would not be good production code at all.
Hello,
This is due to the way that the Codewars testing framework processes data from stdout. Printf prints data without a new line - something that Codewars doesn't like. You can use printf, but you will need to add a new line (\n) sequence at the end of your string. See man printf(1) for more information.
Thanks!
It seems that solutions are accepted that find the following files:
foopng
andfoo.pngbar
when the first argument ispng
. That is wrong and should be checked.This solution returns wrong results! If you have a file
foopng
and your first argument ispng
this filefoopng
is found, but it should not! The dot must be escaped:grep "\.$1"
And if you have a file
bar.pngGGG
the file is found, but it should not. So check for end of line:grep "\.$1$"
NOT best practices!
Neither solutions with
echo
, orecho -e
norprintf
work. I also tried pipeline it tosed 's%$%\r\n%'
, to no avail.Why does
printf
not work. I had to useecho
. Why?This comment is hidden because it contains spoiler information about the solution
I get a Segmentation fault when I use this solution. The size of result is never defined. How could that have worked?
Loading more items...