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.
You can take 2 out of brackets.
I don't know who made this Kata for Java, but you are a psycho! XD
I remember doing this kata in python and it was waaay easier to fix.
Java version have at least 5 times more errors! ><
Marking as resolved
I've added to the description that the sequence should start at 3 not including the offset. Thanks for the feedback
Starting from what? It is not specified anywhere.
Starting from
3
is also strange: a natural start with be0
since0
is also divisible by3
.I had to make a solution like this too, because of the long data type. I had originally had good, concise solution, but had to use a brute force solution like this.
damn, saw math.max and it was described as method for only two integer's
I feel like an idiot after seeing this
sneaky boi
you are right, sorry for that, we can't swap the operands.
And how would you get 9? Remember it's
a ? b ? c
where a=1, b=3 and c=2, you can add some parentheses tootry to check with
a = 1
b = 3
c = 2
you will see 8, not 9
You can change the operations, but the operands order is always a, b and c.
Incorrect when:
a = 1
b = 3
c = 2
biggest number is:
b * (a + c)
I'm pretty sure Java does have precendence in the order in which terms are evaluated. It's what allows us to do stuff like this where we can "nest" statements and change multiply fields of the code without worrying about the order in which it happens.
https://introcs.cs.princeton.edu/java/11precedence/
edit: I agree that it's not best practice, definitely shouldn't be used in a real-world application, but for a simple kata it's useable.
Loading more items...