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.
python new test framework + random tests
python new test framework + random tests + snake_case (with backward compatibility) are required. updated in this fork
Prolog translation
Python: Needs random tests.
python new test framework is required. updated in this fork
'The chosen one will be the nearest to the real line.'
There is obvious cases when two pixel are on equal distance to real line. Which one should I choose? sometimes you expect -41.5 to be rounded to -42 but in next try -69.5 should be rounded to -69
Maybe the description should clearly state which one to prefer or there could be more than one right answer in such a case
python new test framework is required. updated in this fork
CoffeeScript translation
Scala translation
Ruby 3.0 should be enabled
Function name should use
snake_case
JS and CS should use
camelCase
for function namesLimit of
n
could be defined in description.Just noticed a small typo that should be corrected, "exemple" should be example
(Author inactive): Python translation, link here - please review carefully based on following notes
I have checked fixed and random tests using 3 different approaches - mine, K01egA C++, and dfhwze C++ solution.
Kata description states there will be input validation "You also have to check if n is a number, integer and that 1 ≤ n, if it is not the case, the function should return 0." but C++ version at least doesn't do this extensively -> so I just did a few fixed tests for
n < 1
.C++ has 1000 random tests uniformly taken from 1 to 1e10; I divided Python ones in blocks of 30 tests in increasing orders of magnitude from
1_000 -> 10_000
up to1e10
etc.All 3 Python solutions pass full test suite of approx 250 tests in 1 second; seems OK for a 4 kyu to have 250 tests to rule out really inefficient solutions?
Description should be language-agnostic
Loading more items...