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.
We're playing the code golf (https://en.wikipedia.org/wiki/Code_golf) game, tl;dr write a solution with the minimal number of characters. Yes, in real, production code, you'd use
const
orlet
(var
is still valid, but most modern code useslet
unlessvar
is absolutely necessary, since it has slightly different behavior https://stackoverflow.com/a/11444416/12101554), but this is still valid JavaScript.*in professional code, yes
in codegolf (crafting a solution with the fewest characters/bytes), however, anything goes
Literally just a math problem
you need to have the code inside of the curly braces
{
and}
, not below.This feels like a 10 kyu kata.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
What's with the
1 / 0
at the end? Is it just a stylisitic thing since it won't even be ran?This comment is hidden because it contains spoiler information about the solution
the
assert.strictEqual
that the author uses doesn't give good error messages, what it means by "-1 should be 1" or something like that is that "you gave me a -1, but the answer i'm looking for is a 1"Make sure you arent console.log'ging everything, i did that so i was confused of why my solution didnt work for the random tests
also, since ive done this, i can tell you that its looping from 1 to a number related to
n
but is largerI don't know if
user5176194
is saying that this is too hard or too easy. For me, it seems like the perfect ranking since it's easy to implement the solution and the hard part is figuring out the math you need to use to solve it.This comment is hidden because it contains spoiler information about the solution
As i said earlier,
But i'm still trying to wrap my head around how giving the completely random tests in a random assortment is better than organizing the still completely random tests into 1 input and 3 input tests
Loading more items...