Ad
  • Default User Avatar

    man I used math.floor() to get the answer just to realise that could've done this just divided it and type casted into int

  • Custom User Avatar

    blew my mind with its simplicity; I didn't understand how it worked at first. amazing solution!

  • Custom User Avatar

    actually, that's a pretty good insight.

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

  • Default User Avatar
  • Default User Avatar
  • Custom User Avatar

    This is not a correct Roman number (in sample tests):

    for roman number:
    IXL
    expected 39
    but got 59
    

    (The rest of cases seems ok).

  • Default User Avatar

    this solution made me realize that i'm a f idiot haha

  • Default User Avatar

    first you get dry content, which is constant(w0 * (100 - p0)), then we convert back to full weight by using reversal operation with new percentage

  • Custom User Avatar

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

  • Default User Avatar

    Can someone explain please? I'd really appreciate it.

  • Custom User Avatar

    no problem. In the meantime, I strongly suggest that you unpublish it. Otherwise, it may not even survive until tommorrow. ;)

  • 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

    hi,

    About my solution it's rather that the usual expectation on cw is: "if you want us to not use this or that, you have to be sure that we cannot". So I did so to check that. ;)

    CW uses TDD approach, meaning that whatever implementation is capable of passing the whole test suite is a valid solution. If you want to discard some possibilities, it's to you to enforce it (just hoping that users won't cheat the task is... a dream x)

    Note: power users who do betas are generally quite hostile toward katas that announce some requirements but do not enforce them, be warned. ;)

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

  • Loading more items...