Ad
  • Custom User Avatar

    I have changed the division by two for a multiplication times 0.5. Although in most systems this should not be an issue due to compiler optimizations, reality is that due to paralellism algorithms and other factors, multiplications are more efficient than divisions.

  • Custom User Avatar

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

  • Custom User Avatar

    Got it. Between Today and tomorrow I'll work on fixing these issues. I'll leave the limitation part for the end, since it seems it's the hardest to achieve. It will be a big change, but I agree that the kata would be more fun. Again, thanks for the feedback, really appreciated!

  • Custom User Avatar

    Alright, thanks for your comment.

    You are absolutely right about the solution missing the static keyword. Thank you for telling me. I already fixed it.
    Regarding the random tests, they do not always expect false. However, it may appear that they do because the chance of the generated String being balanced is very low. I agree I need to improve on that.
    I also checked out your solution (hope you don't mind), and I realized you were using an actual Stack. I'm assuming you wanted to do it fast to be able to give some feedback (which I appreciate). Since I'm rather new to this kata-creation thingy, and you are much more experienced, do you know of a way I could prevent people from using Stacks, Lists, etc?
    I tried to think of a way, but I was unable. I was thinking that if it were in C or C++, I might use Preprocessor instructions to prevent this from happening in the Preloaded tab. However, I don't know how I could do such a thing in Java.

  • Default User Avatar

    Yeah, I have looked at the rest of solutions, and definitely some of them are better than mine so I've learnt a couple from them. Thanks for your quick response!

  • Default User Avatar

    I really liked this Kata, but after my "solution" in Java passed all the tests and got the message saying something along the lines of " Congratulations, now you may refactor your solution" I added a comment to my code, and when I ran it again it said that not all of the tests were passed. This makes me thing there's an issue with the Tests in this Kata as my solution is considered a solution when in reality is probably isn't.