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.
I laughed (and, tbh, it still deserves the Best Practice vote XD )
i like this logic, bravo man
hacking
Why use reverse, if we can traverse the array from the end?
I must say that it possibly not universal solution, but deffinitely very resourcefully!
that makes two of us, I feel so dumb after I finally get a solution and I submit, someone posts something like this and I feel like a neanderthal. ;D
Are you sure that it is the same code?
This should happens only if the 'nums' was a char[] not a String[];
In the case of the char[] you would need to use result[i] = Character.getNumericValue(nums[i])
It is a short hand if else statment. Each of the statments
(p1 + p2).equals("scissorspaper") || (p1 + p2).equals("rockscissors") || (p1 + p2).equals("paperrock")
are all conditions of the if statament and if any of them are met then the player that wins will be 1.
When it says
int p =
at the start it is stating what will the 1 : 2 equal after the if statment.Man I'm surprised that someone actually replied to a 6 year old solution from when I was trolling around on Codewars :)
Aren't you supposed to implement this method on your own?
G E N I U S
This comment is hidden because it contains spoiler information about the solution
using a ternary operator, this is so genius!
nice solution
What the... I neet to drown myself by stuffing my head into toilet..
Loading more items...