5 kyu
Boxes in boxes
68 of 115dfhwze
Loading description...
Algorithms
ASCII Art
Performance
Strings
Puzzles
Memoization
Recursion
Mathematics
Dynamic Programming
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Great kata of the ASCII art series, quite challenging.
Typo: hadcoding
fixed
Also it looks like you forgot some
*
in the aligment chart.Edit: There is actually a message below regarding this.
It was fixed some time ago, but you found another gap in there. Should be fixed now.
CoffeeScript translation
thank you
My code passes all the sample tests, and the fixed tests, and passes 12 of the random tests before timing out. Is anyone else seeing this? And is there a way to bypass the timeout to see if my solution can complete all the tests succesfully?
I would like to see how other people solved this, but can't do that until my code completes its attempt.
Ps. I'm reasonably sure my code is pretty efficient, and it is creating the boxes-in-boxes correctly.
I've had a look at your current solution. You need to optimise for performance. I suggest you keep trying to make your solution faster.
I think there is an error in the diagram on alignment (showing spaces as asterisks).
We were given:
But I'm fairly sure the diagram should be:
There must be 7 characters on each line
excellent spot! fixed
I have a posible solution but in the test with n = 20 it shows the next error: RangeError: Maximum call stack size exceeded at draw (test.js:10:11) at act (test.js:55:26) at Context. (test.js:173:9) at process.processImmediate (node:internal/timers:471:21)
It could be because the last step when convert de array to string joining with \n?
Are you using a recursive solution?
No, but the last 'join' was not the problem. It seems the spread operator applied to big array and pushed to anoher array caused the error on the stack.
bigArray.push(...bigArray.slice(1).map(blabla))
I found this explanation:
"The RangeError: Maximum call stack size exceeded is thrown when a function call is made that exceeds the call stack size. This can occur due to the following reasons:
In my case I think the third point is the cause: "Out of range operations" when I use 'push(...bigArray)' because they are too many args to the function. I've fixed it.;)
great!
Awaiting approval ;-]
Yep, here's the ranks breakdown:
Tough one to pick an appropriate rank it seems.
.
Hi,
Last line of the example of the "Alignment" section:
suggestion: you could maybe use multiline strings, to format the outputs (not that it changes much. Your call... Might actually be a "bad" idea, because the leading and trailing spaces are less obvious...)
becomes for example
issue fixed, suggestion under investigation :)
I'll keep the multiple strings to indicate bounds better.
Should enforce a code length limit to prevent excessive hardcoding.
done
Shouldn't that
width
be3
?Yep, another brain fart from me.