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.
It's normal practise use [].someFn .call()/.apply(). If you like save memory, why you chose JS?
Please help.
What do tests mean? What arguments do they receive?
"Single pair of end caps defined - no nesting"
"Multiple pairs of end caps defined - no nesting"
"Single pair of end caps defined - with nesting"
"Multiple pairs of end caps defined - with nesting"
"Multiple open and close caps are same character - with nesting"
Balanced and unbalanced case. I wrote a function that works perfectly and I can't break my function.
When you create kata please write description's tests smarter.
I can't understand next:
Time: 323ms Passed: 33 Failed: 8
Single pair of end caps defined - no nesting
Balanced
✘ Expected: true, instead got: false
Single pair of end caps defined - with nesting
Balanced
✘ Expected: true, instead got: false
✘ Expected: true, instead got: false
✘ Expected: true, instead got: false
Multiple pairs of end caps defined - with nesting
Balanced
✘ Expected: true, instead got: false
✘ Expected: true, instead got: false
Multiple pairs of end caps defined - no nesting
Balanced
✔ Test Passed: Value == true
✘ Expected: true, instead got: false
Multiple open and close caps are same character - with nesting
Balanced
✘ Expected: true, instead got: false
For people who speak English a little hard translate this description. If I see what function receive and what tests want in output I guess how function must work.
Sorry for incorrect mark. Nice kata. Be stronger in algorithms.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
So simply :)
Yes. You're right. Why n(1) => 81; n(2) => 512 etc. What does function return when n is 5?
I can't understand what does function receive? Tell more for dummies
This comment is hidden because it contains spoiler information about the solution
JS:
Passed: 199 Failed: 6
Basic tests are passed. How can I guess why random test are failed? If I get next answers:
Testing fortune:
✘ Expected: true, instead got: false
JS:
✔ Test Passed: Value == [-2,-1,3]
✘ Expected: [[-3,-2,5],[-3,-1,4],[-3,1,2],[-2,-1,3]], instead got: [[-3,1,2],[-2,-1,3],[-3,-1,4],[-3,-2,5]]
✘ Expected: [[-3,-2,5],[-3,-1,4],[-3,1,2],[-2,-1,3]], instead got: [[-3,1,2],[-2,-1,3],[-3,-1,4],[-3,-2,5]]
✔ Test Passed: Value == No combinations
✔ Test Passed: Value == No elements to combine
What's wrong in my case? What order does compiler want?
JS version:
arr = [1, -1, 2, 3, -2, 4, 5, -3, -3, -1, 2, 1, 4, 5, -3 ]
n = 3
find_zero_sum_groups(arr, n) == [[-3, -2, 5], [-3, -1, 4], [-3, 1, 2], [-2, -1, 3]]
P.S. In this case what about combinations [-2,1,1] and [-1,-1,2]? They must be in array, isn't it?