Ad
  • Default User Avatar

    It can be solved using pure logical inferences. However, you will likely have to sit down with your pen and paper to figure out the implicit and implied rules that are natural extensions to the rule set given.

  • Default User Avatar

    Thank You for pointing me to this.

  • Custom User Avatar

    It was already discussed and comes back from time to time. You can read the github discussion for more details.

  • Default User Avatar

    It would be useful to see the inclusion of relevent markers for solutions such as performance.

    Right now, Kata solutions can be ordered by clever and best practices which are both determined by the community and a great way to rank the subjective parts of programming.

    We don't currently have any indication as to which solutions are doing better performance wise. A well-informed and knowledgable developer may be able to deduce the most performant solution from those provided, but these stats would be helpful for upcoming developers. I also belive that if these stats are available on the solutions page and not part of the test, it will allow people to pick up performace as a goal as they get more comfortable in the language.

    The methods I could see would be time for completion of Kata on final submission (because you would have to run the Kata outside of debug mode), and possibly memory usage if such stats are available for the language.

  • Default User Avatar

    Hey,

    without seeing any code, it's difficult to know what might be going on. Here are a few ideas though (some you may have tried)

    1. the Kata specifies that all non-spaces should be treated the same, so treat \n \t \r just like you would any other character that needs to be shifted

    2. make sure when you take indexes for where you are removing spaces that you aren't altering the string at the same time since this will change indexes for following spaces.

    3. depending on how you're inserting the spaces back into the output string, you may be accidentally overwriting the same index multiple times, it might help to print out the indeces using your languages println / log function

    I hope these give you some clues and ideas as to were your issue resides.

    If you need any additional help, I'll be happy to follow up with another reply.

  • Default User Avatar

    Hey,

    The Kata talks about shifting the input string characters by n spaces n times. I see you are using n as a reducing counter and calling encode recursivly. You're getting the right output your first time through the function because n equals what it is supposed to be; however, during your next recursive call n is 1 less. Now when you use n in your swap function, things are only being moved over n-1 spaces instead of the full n.

    You could use a loop 0..10 instead of recursion, or you'll have to remember n's origional value throughout your recusions somehow (depends on the language).

    I hope this helps, let me know if you have any questions about my reply.

  • Default User Avatar

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

  • Default User Avatar

    I like how holding the current fib window as a tuple allows you to advance it without a third variable. nice!

  • Custom User Avatar

    random tests?

  • Default User Avatar

    This solution is based on a simple state machine.