Ad
  • Custom User Avatar

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

  • Custom User Avatar

    OP solved it, closing

  • Custom User Avatar

    OP solved it , closing

  • Custom User Avatar

    You shoul calculate percent/100 before while. And you might add +1. i.e. percent = percent/100 + 1. Cause x + x*0.1 = x.1.1

  • Custom User Avatar

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

  • Custom User Avatar

    One small performance change. I would calculate "percent / 100D" before the while loop in order to prevent the slight extra work added for each pass. The rest is much cleaner than mine :)

  • Custom User Avatar

    From the perspective of the code that calls the method it doesn't matter at all, in Java parameters are always passed by value. Whether method code should be allowed to reassign parameter variables or not is primarily opinion based or just a matter of taste. With short code like this I personally don't see more disadvantages when modifying p0 compared to declaring another variable which might be considered additional noise. And with rather long or complex method code you have a different problem anyway: You're unable to quickly understand what it does anyway.

  • Custom User Avatar

    Quite lengthy code but that is how you actually should do it when not going for Java 8.

  • Custom User Avatar

    I made the modifications (the java version was really a mess!) and republished it, but the previous soluitons aren't invalidated yet... I don't know if this is just the server which is not up to date or if my modifications won't actually get realmy published because there are already too much completions to the kata... Let's see it in the next days...

  • Custom User Avatar

    Java: Basically same for me. Can some admin have look into this? Seems like there is an issue with Submit tests. Unfortunate to see it not corrected for such a long time.

  • Custom User Avatar

    Some of us are at a level where that is a lot to explain; so thank you for replying to their question.

  • Custom User Avatar

    Magic! :]

    But seriously, sloppiness.

  • Custom User Avatar

    There isn't much to explain. How would you calculate fusc(5)? Well, 5 = 2 x 2 + 1, and fusc(2 x 2 + 1) = fusc(2) + fusc(3). fusc(3) = fusc(2 x 1 + 1) = fusc(1) + fusc(2). fusc(2) = fusc(2 x 1) = fusc(1) = 1. Put these results together and you get fusc(5) = 3. Your job is to implement the function fusc.

  • Custom User Avatar

    I too would like more directions on what this kata is even asking. So I'll just throw this comment in to draw more attention it it!

  • Custom User Avatar

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

  • Loading more items...