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.
This comment is hidden because it contains spoiler information about the solution
The problem was with my code indeed! I simplified the solution and it passed normally on Codewars now.
I have my local repo setup with TS, mocha and ts-node and I execute the
test
task in package.json to verify that all tests pass.It's with this setup that my erroneous code passed and I want to investigate further why that was the case.
When I executed via a classic node cli terminal locally, it threw the same memory error as Codewars did!
I will post here my findings when I find out what magic did the TS compiler and my code passed in the first iteration.
It throws this error even with the sample tests which use simple and small arrays. The same sample tests and even more complicated ones with object references pass with flying colors locally. This memory error is very strange. That's why I posed the question tentatively and not marked as an issue.
I've authored a JS solution that works on my machine (at least for various cases that I created and the sample tests provided), however when trying on CodeWars I get this stacktrace:
Can someone please tell me if this error originates from my code or it's a CodeWars platform error?
The general error at the end reads "JavaScript heap out of memory" yet I am not using memory intensively, working with indices mostly, nor am I modifying input arrays.
This comment is hidden because it contains spoiler information about the solution
Pff! I think the only think he revised was the kata's rank (from 4 to 5). I misread the revisions: https://www.codewars.com/kata/neutralization-reaction/revisions
It is my 2nd published kata (and the first to be ranked) so forgive my nervousness and ignorance.
Ok, I'm approving the translation. Please review the updated code because I think Voile, who approved the kata, made a lot of changes and I didn't have time to see what changed. :)
Thank you for your contribution!
Your translation seems fine and I want to approve it, but I want to ask you something first.
I have fine tuned the test cases for the JS version, namely all test cases have guaranteed shuffled acid, bases data sets and explicit tests for NH4OH, which is a unique base and could be missed during the shuffling and slicing of the data. However, due to codewars' technical issues my republishing efforts seem to be constantly timing out.
Do you think that if I approve this version it will be possible for you to republish the updated tests later on or will it be as difficult for you as it is for me and we must wait a while until things smooth out on codewars' back-end?
To save an easily accessable bookmark to your currently working kata you can add a star (top-left star link under the kata's name) or add it to a custom collection.
Either way the kata's you have ever worked on (attempted to provide a solution) and are incomplete are saved in your profile page under the Kata section in the Unfinished tab.
Notice that if you want the partial solution to be saved along with the reference to the kata, you must hit the Attempt button at least one time. If you run only the local test cases the partial solution will not be saved. At least this is how it worked so far and this may be subject to change.
Since you edited your response and my comment became obsolete, I edited it too to stay relevant in its context.
Do you think that it is worth investing some time into setting more semantic names for functions and their arguments?
...and the prize for the most unimaginative solution function name of the year (i.e. "solve") goes to... this kata!
Other than that, however, it was a nice challenge. Congrats! :D
PS: Actually there are several other katas sharing the same generic solution naming practices, but I thought I would just drop my comment on this one, because someone has to do it I guess.
It's perfect now! ;)
Consider renaming all references of circle with circumcircle (or circumscribed circle). This is the proper name for the unique circle that touches every vertex in the polygon, and in which we are interested. Other than that I enjoyed this kata! :)
Java translation kumited. Please approve.
Try a regex that targets that last ',' and replace it in the formatted string or use
lastIndexOf(',')
to the same effect.Loading more items...