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.
Totally agree
( JS, possibly others )
Needs random tests.
C++ translation: https://www.codewars.com/kumite/64a89e76dddc251d5fdfced4?sel=64a89e76dddc251d5fdfced4
oky thanks :3 I understand a little I think
The point of this kata is not to write a function
boolean isDiv5(String s)
, but to create a regular expression that will match all strings that represent in binary a number divisible by five and only these strings.For example, this regular expression should match
"101"
,"0"
and"1111"
because they represent5
,0
and15
.But it should not match
"111"
,"10000"
nor"1"
as they represent7
,16
and1
.Excellent kata. But why is everything so strange here? I am not yet fully familiar with Java and I don’t know other languages, and I just can’t figure out where to get the string from and what to return. Why complicate things so much? :( Where are these regular methods with the usual String parameter? ;(
Nice kata, simple yet challenging, made me refresh my knowledge on regex
I removed the global flag of the regex and then it passed the tests.
When I test my regex with console.log I get true, but the test case says "expected false to be true". This happens on about 5 out of 500 tests, but it works if I test it in any other environment.
(console.log(divisibleByFive.test('1010')))
Definitely needs random tests.
It's not that easy. I advice you to practice on some easier katas involving regular expression. I believe this kata is not easy (I don't really know, I didn't solve it).
I wrote this expression at the beginning of my regex pattern, but it doesn't help me
^$
This comment is hidden because it contains spoiler information about the solution
.
Loading more items...