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.
Java Translation
This comment is hidden because it contains spoiler information about the solution
JS update fork
Maybe add tag "combinatorics"?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I worked out a mathmatical expression. It only fails in some octal cases (8,6) (8,7).
I have no idea why it isn't working and I already asked a question a week ago.
Could you show the expected results? Because if I had the results, maybe I could see my mistake as no one aswered my first question.
This comment is hidden because it contains spoiler information about the solution
CoffeeScript translation
TypeScript translation
Javascript Translation
Python translation
How close am I to optimizing it enough? 64ms on basic tests, 60ms on short tests, 10 lines.
i dont see this in either C or SQL
I managed to get my first, incorrect solution through the tests. The issue that my solution was not initially dealing with was related with the 0 digit getting in the beggining of the number. This was caught by the test with the number 1027. In this case, the expected output is -1, since the digit 1 can only be replaced by 0. I think there should be a test with a number like 2013. I managed to satisfy the 1027 test by just returning -1 for a number that ended up with 0 in the first position, while my algorithm was still incorrect. It would also reject a number like 2013 returning -1 instead of producting 1320 which is the expected answer.
This is my first comment, so excuse me if I don't know how to post formatted code demonstrating this issue.
I think you can see my first accepted (incorrect) solution for this.
Loading more items...