Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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
blew my mind with its simplicity; I didn't understand how it worked at first. amazing solution!
actually, that's a pretty good insight.
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.
clever
fixed
This is not a correct Roman number (in sample tests):
(The rest of cases seems ok).
this solution made me realize that i'm a f idiot haha
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
This comment is hidden because it contains spoiler information about the solution
Can someone explain please? I'd really appreciate it.
no problem. In the meantime, I strongly suggest that you unpublish it. Otherwise, it may not even survive until tommorrow. ;)
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!
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. ;)
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...