Hi, mb smbd know what is that error and how in can be fixed - array lengths differed, expected.length=4 actual.length=6; arrays first differed at element [3]; expected:<[pini]> but was:<[ou]>?
The error you're encountering is because Arrays.sort() doesn't return an array but instead sorts the array in place. So, you can't directly use Arrays.equals() to compare the sorted arrays. You need to sort the arrays first and then compare them.
Can smbd tell my why that error in my code
class java.lang.Integer cannot be cast to class java.lang.Character (java.lang.Integer and java.lang.Character are in module java.base of loader 'bootstrap')
OP solved the kata
This comment has been reported as abusive
Hi, mb smbd know what is that error and how in can be fixed - array lengths differed, expected.length=4 actual.length=6; arrays first differed at element [3]; expected:<[pini]> but was:<[ou]>?
The error you're encountering is because
Arrays.sort()
doesn't return an array but instead sorts the array in place. So, you can't directly useArrays.equals()
to compare the sorted arrays. You need to sort the arrays first and then compare them.Can smbd tell my why that error in my code
class java.lang.Integer cannot be cast to class java.lang.Character (java.lang.Integer and java.lang.Character are in module java.base of loader 'bootstrap')
This comment is hidden because it contains spoiler information about the solution
OP solved it, closing
Because your convertion from
int[]
toList
is wrong.This comment is hidden because it contains spoiler information about the solution
you're very welcome
seems like you passed the kata?
in which case, if your
question
was fully answered, close it out by clickingMark question as resolved
Big thanks, man
at least this:
getNumericValue
notNumericValue
and there is more, but start with these
This comment is hidden because it contains spoiler information about the solution