Ad
  • Custom User Avatar

    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 with anyMatch(...) we test each predicate if it's returns true for incoming number.

  • Custom User Avatar

    Translated into Java

  • Custom User Avatar

    Yes, thank you.

  • Custom User Avatar

    Translation is updated. Hope I got you right.

  • Custom User Avatar

    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 implement public String execute(String code, InputStream input) or public OutputStream execute(String code, InputStream input).

  • Custom User Avatar

    Java translation has been kumited.

  • Custom User Avatar

    Any chance to have TestNG support?

  • Custom User Avatar

    Java translation has been kumited

  • Custom User Avatar

    Why not yet approved? 7 month ago... geez...

  • Custom User Avatar

    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.

  • Custom User Avatar

    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?

  • Custom User Avatar

    Translation to Java has been added.