• Assertions in Java are not in the right order, which makes the failure case misleading.

  • Yep, these are in the wrong order for Java assertions.

  • i am not sure but in java test i think "expected" and "but was" should be swapped

  • undefined and null are also falsy values. While using Number, those two falsy values would return a NaN output.

  • Does this returns 'ab' (no sum performed)?

  • Thanks. I probably fixed that.

  • The JavaScript details show the A1 square in the top left corner. It would be better for those who are not that familiar with chess and solving more than this one problem if A1 was in it's correct spot in the bottom left hand corner, or in the top right hand corner. It doesn't affect the solutions but would help with understanding.

  • You shouldn't beat yourself up : I also think too much of myself as producing 'garbage' code - but that is not the point of kata's like these. They are meant (at least for me they do) to think about a problem and produce a solution, and then trying to clean the solution as best as I possibly can. And that in itself is invaluable training. :)

  • Thanks a lot, Chrono79!

  • chars length is guaranteed to be 5 (at least that's what's written in the instructions), but that's not the real problem with your code, the problem is "302" doesn't contain "32", etc.
    I wouldn't use long either, the count can't exceed 5 ;)

  • Without proper markdown we can't see what the actual and expected values were (not that it helps too much either, at least, in this case).
    Try pasting your code, with proper markdown and mark your post as having spoiler content, that way it'll be easier to help you.

  • Hi, I have passed all of the sample tests but I'm having problems with the random Tests and I don't know why.
    This is the stack trace:

    java.lang.AssertionError: expected: but was:
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:834)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at SolutionTest.randomTests(SolutionTest.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:39)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:79)
    at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:70)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
    at io.qualified.junit5.RunTests.main(RunTests.java:25)

    Any help? Thanks!

  • So, could somebody review the translation, please?

  • Solving this took half an hour. I made a dict with array as a keys and frequency as a value. It is good to see more clever and elegant solutions than my garbage code

  • Loading more items...