Ad
  • Custom User Avatar

    Hi, thanks for taking the time to look at my problem. I'll make changes later.

  • Custom User Avatar

    Hi, the solution will pass only if you find a way to solve the problem without loops. as wrotes below in the comments inList numbers are sequentially from 1 to n this should help you to solve the problem without loops

  • Custom User Avatar

    your solution has a bug that incorrectly handles four zeros in sequence
    example input data [9, 0, 0, 0, 0, 0, 9]
    your code will return [ 9, 0, 9, 0, 0, 0, 0, 0 ]

  • Custom User Avatar

    Suggestions:

    • Change return type of add to int Function(int) add(int n){ ... } and solution setup to something like:
    /* insert return type */ add(int n){
      return;
    }
    

    I think that this looks much nicer in strongly typed languages. If someone will solve it with dynamic then fine, but static types are so much neater :)

    • Perform two assertions, where first one checks what is returned by add(x). Users who do not know how to do "functions in functions" will attempt to return strange things from add, and tests will crash attempting to call an uncallable thing, resulting in confusing failure messages. You can try something like expect(add(x), isA<int Function(int)>(), reason: "\nadd(x) should return a function");, maybe extracted to a helper function like following pseudocode:
    function dotest(a, b, expected) {
      wrapper = add(a);
      expect(wrapper, isFunction<int->int>);
      actual = wrapper(b);
      expect(actual, equal(expectd));
    }
    

    (make sure to use reason: for clear failure messages).

  • Custom User Avatar

    Hi I checked
    your code gives wrong result for
    this sequence [9, 0, 0, 0, 9, 1, 2, 0,
    1, 0, 1, 0, 3, 0, 0, 1,
    9, 0, 0, 0, 0, 0, 0, 9] can you check locally

    javascript kata tests output incorrectly expected results and obtained results from the user

  • Custom User Avatar

    needs to be checked
    Translation Dart

  • Custom User Avatar

    I don't quite understand you. Can you show me an example?

  • Custom User Avatar

    I was thinking about using 3-tuple for the return type, which is always a value with three integers. What do you think?

  • Custom User Avatar

    Hi in dart there are tuples and there is a fixed array, what are these data structures for in this task?

    The test headers were taken from python solution during translation

  • Custom User Avatar

    Does Dart have 3-tuples or fixed size arrays?

    I would also suggest more concise titles for tests sections, like just "humanYearsCatYearsDogYears(1)" instead of "Test humanYearsCatYearsDogYears one" or "Random test 42: humanYearsCatYearsDogYears 1 human years". I think that it's sufficiently clear, more concise, and easy to copy and paste into local IDE.

  • Custom User Avatar

    now on dart
    Translation Dart

  • Custom User Avatar

    No, that's a bug. Fixed it. Thanks.

  • Custom User Avatar

    This translation has no example tests, is this intentional?

  • Custom User Avatar

    needs to be checked
    Translation Dart

  • Custom User Avatar

    you don't know the ascii table by heart 0_0

  • Loading more items...