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.
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?
For python I didn’t use numpy, just plain python. But I have not yet passed the final test (error at an edge case).
Well, I think if you read a bit at Wikipedia, it isn’t to difficult: https://en.wikipedia.org/wiki/Integer_(computer_science)
https://en.wikipedia.org/wiki/Two's_complement
https://en.wikipedia.org/wiki/Endianness
Maybe this is clever if you are a slow typer and reader or have a very limited space in memory or disk, but for me it seems like code obfuscation. Never mind, just my opinion.
Well, it is an issue, because the test cases don’t detect wrong results. How is this just a suggestion? It is wrong by the definition given in the description.
Can’t anybody else fix the kata or the test cases?
Add a test case for args (1, 96, 3612) which should result in 9 and NOT in 7 (as it is accepted now). This was already said by jolaf.
This is still not solved. The args (1, 96, 3612) are still accepted if the result is 7. But it should only be accepted if the result is 9! Please add a test case for this.
Solution is wrong for the cases (2211,0) and (11,0). Test case should be added.
This is the first solution I have found, that is fast and works with all the test and edge cases (i.e. negative numbers, lots of 0 and 1 as arguments).
Loading more items...