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.
Thank you, I´ll look at it :) Although I think I understand the visibility and accsess modifiers in Java, I just didn´t know it´s possible to declare more classes in one file and the rules around that.
If you need more info about various visibilities in Java
https://iq.opengenus.org/public-private-protected-in-java/
Interesting. Thanks for sharing!
So the solution was just to remove the public modifier :) Well, at least I´ve learned something new about java.
Thanks for your suggestion. It would be quite strange solution for java... but I´m gonna try it.
I don't know much about java, but I think the only way is to declare those classes private inside the main class (Leetspeek class in this case).
./src/main/java/Leetspeak.java:31: error: class Encoder is public, should be declared in a file named Encoder.java
public abstract class Encoder {
^
./src/main/java/Leetspeak.java:35: error: interface Dictionary is public, should be declared in a file named Dictionary.java
public interface Dictionary extends Map<String, String> {
^
./src/main/java/Leetspeak.java:39: error: class LeetspeakDictionary is public, should be declared in a file named LeetspeakDictionary.java
public class LeetspeakDictionary implements Dictionary {
^
3 errors
I really tried to make an OOP exercise out of this kata. And of course, in my IDE every class has its own file. But how am I supposed to submit my result here correctly?
I can't really understand your exact question x/ Could you explain it? There is no 'app' here, just tests :X When you hit test / attempt, you are running the code, so I'm confused what you're asking :P
Thank you! Next time I am going to try every possible digit :))
One more thing, is there some way to run the code within the app? Or just the tests so I need to use another IDE for debugging?
Your reduce method has incorrect condition. Try using
System.out.println(n)
to debug it.This comment is hidden because it contains spoiler information about the solution