Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    If you need more info about various visibilities in Java
    https://iq.opengenus.org/public-private-protected-in-java/

  • Custom User Avatar

    Interesting. Thanks for sharing!

  • Custom User Avatar

    So the solution was just to remove the public modifier :) Well, at least I´ve learned something new about java.

  • Custom User Avatar

    Thanks for your suggestion. It would be quite strange solution for java... but I´m gonna try it.

  • Custom User Avatar

    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).

  • Custom User Avatar

    ./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?

  • Custom User Avatar

    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

  • Default User Avatar

    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?

  • Custom User Avatar

    Your reduce method has incorrect condition. Try using System.out.println(n) to debug it.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution