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's run a predicate against number that first converted to string. Predicate is an interface with single method
boolean test(T object)
(T is a String in this case).With
Stream.of(...)
we creates a stream of predicates. And withanyMatch(...)
we test each predicate if it's returns true for incoming number.Translated into Java
Yes, thank you.
Translation is updated. Hope I got you right.
I've fixed translation by using
InputStream
for input. But I don't want to change output to stream too as all tests are requires simple string as output. Also I don't understand how to have it optionally. Either we require coders to implementpublic String execute(String code, InputStream input)
orpublic OutputStream execute(String code, InputStream input)
.Java translation has been kumited.
Any chance to have
TestNG
support?Java translation has been kumited
Why not yet approved? 7 month ago... geez...
Here another example:
Testing for [1, 1, 1, 1, 1] and 20
It should work for random inputs too - Expected: [0,1,1,0,1,1,1,1,0,0,1,1,0,1,0,0,1,1,1,1,1,1,0,1,0,0,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,0,1,1,1,1,0], instead got: [1,1,0,1,1,1,1,0,0,1,1,0,1,0,0,1,1,1,1,1,1,0,1,0,0,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,0,1,1,1,1]
Just in case: it's javascript that I'm trying to solve on.
Standart tests passed, but random tests for JS are failed because it expected addition zeros at the begin and the end.
From start array [0,0] with 36 iteration my script returns 74 zeros (36 in both direcitons plus initial two), but expecting array is 76 zeros. Is it correct?
Translation to Java has been added.