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.
Not an issue
maybe first and last string wouldn't consist of spaces
@dinglemouse: There is also a nice variation of this great kata: https://www.codewars.com/kata/next-smaller-number-with-the-same-digits
@Mrityunjay Bhardwaj: It was me, who translated this kata to Java. As you can see below: There was a comment "Java-Translation kumited!"...
There is no problem in the kata. (25 warriors did it in Java until this moment). And like dinglemause said it before: There is no biggertest for 1286608618.
I tested it last minute, if such test would be succeed: Without problems with the solution.
Have you you written the input value to the console for checking? Maybe your code changed a value in a wrong way?
Look a few comments down below: Steffen is the one who translated it and he has certainly a much better command of Java than me.
@Mrityunjay Bhardwai.
FYI - I have just moments ago successfully completed the
Java
version of this Kata. There are no problems at all.You said your code failed on a
Java
test calledBiggerNumber
with input of1286608618
.biggerTests
)So I don't know what you are looking at... but it not the current Java submission test cases
@dinglemouse yes, maybe you are right.... but i dont have an authority to check the Junit tests complectely.... and @GiacomoSorbi i cant uderstant what do you mean by "Java translator comment" (do u mean the one who is a JAVA programmer and solved it before?) sorry i am new here.....
@Mrityunjay Bhardwai, I know you think you are returning the correct result but it might be worth triple-checking that it's not you returning that -1. Sometimes the JUnit tests some of Katas are written wrong and the actual/expected values are reversed. It can lead to confusing situations like this.
(Not saying that it the case here... but it might be)
Because the input number is "1234567890"..... So the next number using the same digits should bE : "1234567908" But insted your code returns "1234567980 which is the second next biggest..... Not the "next" biggest!
Hope it helps.... :)