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.
My guess would be that
filter
creates a new array and populates it, whilereduce
just generates a single number.It's converting the mean into an index for the string.
In C, a string is null-terminated by definition. All
string.h
functions assume this. If you pass garbage tostrlen()
then it will spin through memory until it finds a'\0'
or generates a segmentation fault.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Given this specification, I was expecting no more than 1 buggy line per challenge id. However, the test code doesn't follow this rule. Random test cases can have multiple buggy lines per id. It's also explicitly countered by your comment to Martinez below. Would you update either the description or test code so they match? Thanks.
This comment is hidden because it contains spoiler information about the solution
Not only can I bend code with the power of my mind, but I can also "remotely view" it from dozens of inches away. ;-)
Don't forget lift vs elevator, biscuits vs cookies, crisps vs chips, chips vs fries, fanny vs ...nevermind. 😈
Two problems:
...zlet !== 'A'|'B'|'C'|'D'|'E'|'F'|'G'|'H'|'K'...
The|
performs a bit-wise OR. In JavaScript, performing it on strings returns0
. So you're comparing a string to numeric zero....zlet === "A" || "B" || "C"...
The||
performs a logical OR. In JavaScript, a null string isfalse
and all other strings aretrue
. So this expression evaluates aszlet === true OR true OR true
. Of course,zlet
is a string not a boolean.You need to rethink those four lines. I tested your code with the conditionals corrected and it works fine.
BTW, you should submit your questions labeled as
Question
so that folks will more be likely to respond.JS needs random tests.
Maybe one of the yokels got it. Nothing better than barbequed gater L's.
This comment is hidden because it contains spoiler information about the solution
You must have the character sequence
add
in your code somewhere. The prohibited instruction check is simply astrstr()
call..
Loading more items...