Ad
  • Custom User Avatar

    Python:

    Execution time: 246.01 microseconds

    This barely tells anything to the person solving the kata.

  • Custom User Avatar

    python version

    just how good does the solution need to be? I get times around 200 - 280 ms for running all 10 random tests (100 invocations each) so average time around 250 usec, this seems pretty good (to me). however, not a single random test passes the time constraint (all rsults are correct)

  • Custom User Avatar

    Description states that $-1600 \le r \le 1600$, however the test cases in Python (and possibly other language) only have positive radii. Possible typo?

  • Custom User Avatar

    Kata is unbalanced between languages. Brute-force works easily in JS while it times out in Python (yeah because Python slow, a big test case runs in under 50 ms in JS while the same takes more than 2 seconds in Python).

  • Custom User Avatar
  • Custom User Avatar

    I think the Python performance tests are broken.

    I can't be sure, because it won't let me pass the test, but the test harness outputs this:

    Performance Test Batch 1  
      Test Passed  
        Log
          12.373924255371094
      Execution time: 12.37 ms
      Completed in 1.53ms
    

    The log entry and 'execution time' were produced by the tests, while the Completed in line is the Codewars test library itself. The latter meshes with my own local tests, that my solution is plenty fast (my laptop completes any of the performance test inputs in ~170µs).

    Why does the kata test report the time taken as 12.37ms here? The whole performance section only takes 14.81ms, in total.

  • Custom User Avatar

    Are there any cases that take a long time to execute (javascript)?

    In the basic tests, the longest execution time falls between 30 to 50 ms.

    However, I still fail to pass the 12000ms limit.

    Additionally, due to the timeout error, I am unable to print anything.

  • Custom User Avatar
  • Custom User Avatar

    The reference solution sometimes finds the wrong solution (this happens quite rarely). Here is one expression I came across in random tests:

    const exp=
    `  CDBA
    *   D
    ------
    = 9900`
    
    // reference solution => 2475 * 4 = 9900
    // correct solution   => 1650 * 6 = 9900
    
  • Custom User Avatar

    Haskell random tests have some issues

    • Generated lists never contain duplicates
    • Values for c are rarely products of items in the list

    Fork that fixes these along with some improvements to the reference solution.

  • Custom User Avatar

    I checked and found that the Java and Kotlin translations have the exact same issues with hidden zeros. The JS version is fine, but needs to have the same test updates.

    Here are forks that fix these issues:

    • Java (test updates and the hidden zeros fix)
    • JavaScript (just the test updates)
    • Kotlin (test updates and the hidden zeros fix)

    Interestingly enough, the Kotlin translation has a direct port of the Python and Java reference solution used for testing but the 'Solution' solution is a different one altogether, one that doesn't have the hidden zeros issue.

    A note on the MINE_RATIO constant: the Kotlin and Java translations were using a random range (from 8 up to 12, inclusive), but that's variability doesn't really add anything to the tests in my experience. In the interest of consistency I felt it better to just use the fixed constant there too.

  • Custom User Avatar
  • Custom User Avatar

    I got to kata myjinxin2015
    Translation Dart

  • Custom User Avatar

    Thanks for the interesting kata!

    I noticed the description invites us to go for a one-liner:

    "Are you a One-Liner? Please try to complete the kata in one line (no test for it) ;-)"

    While I accepted the challenge for fun, I generally don’t support encouraging the one-liner culture — especially in a 7 kyu kata where many less experienced Codewarriors are just getting started.

    Writing overly compact code may look clever, but it often sacrifices readability and maintainability — a double loss, both for the author and the reviewer.

    You can absolutely mention this kind of challenge in the description as a fun side quest — just be sure to remind others:
    challenge yourself, but don't try this at home! 😄

    That said, the underlying idea and use of bitwise manipulation made for an enjoyable problem.
    Thanks again for the challenge!

  • Custom User Avatar
  • Loading more items...