+ 8

Code Coach Kaleidoscopes in Java [SOLVED]

There seems to be an issue with one of the hidden tests in Java for this challenge. Four tests work, one doesn't and supposedly this is an easy challenge, but other people complain about it in other languages. As I haven't seen any help on the issue in Java, I have decided to ask for some help here at the forum. Thanks in advance.

31st Jul 2020, 10:48 PM
D.R.
D.R. - avatar
4 Antworten
+ 5
That's my best guess, Sandra. The fail is in a hidden test, though. 😕 Thanks for answering! 🙂
1st Aug 2020, 12:36 AM
D.R.
D.R. - avatar
+ 2
To anyone who is interested in solving the problem in Java, I had to look around a bit, but problem was solved. Hint: Instead of using regular double, there is a class in math called BigDecimal that solves rounding precision issues. I had no idea it existed, so I definitely recommend the check! :)
1st Aug 2020, 1:50 AM
D.R.
D.R. - avatar
+ 1
There were some rounding issues, maybe your test case hits one of them too...?
1st Aug 2020, 12:33 AM
Sandra Meyer
Sandra Meyer - avatar
+ 1
I have try the BigDecimal class, but still got only one wrong at the 4th case. Then, i am also tried string format, but still got only one wrong at 5th case. Can you show me the code?
14th Sep 2020, 11:50 PM
Radin Misbah
Radin Misbah - avatar