Ad
  • Default User Avatar

    I like how you multiply the result by 256 before adding the parsed value.
    I shifted my parsed value and then added it to the result.
    Your solution looks way nicer :)

  • Default User Avatar

    okay, the provided test cases seem to be "semi-optimal", since the random tests tend to fail. I didn't change the code compared to the version in my first reply, but after a few times pressing attempt&wait, the kata was completed.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Pressing "Test" passes the tests.
    Pressing "Attempt" solves many tests, even many data-sets within the random_tests.
    However, the random_tests fail after many sets.


    STD Err:
    main.cpp:63:34: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
    for (size_t index = 0; index < lhsSize && areEqual; ++index) {
    ~~~~~ ^ ~~~~~~~
    main.cpp:155:50: warning: 'sizeof (output)' will return the size of the pointer, not the array itself [-Wsizeof-pointer-div]
    assertArraysEquals(output, sizeof(output)/sizeof(int), output_gt, sizeof(output)/sizeof(int));
    ~~~~~~~~~~~~~~^
    main.cpp:155:89: warning: 'sizeof (output)' will return the size of the pointer, not the array itself [-Wsizeof-pointer-div]
    assertArraysEquals(output, sizeof(output)/sizeof(int), output_gt, sizeof(output)/sizeof(int));
    ~~~~~~~~~~~~~~^
    3 warnings generated.

    Max Buffer Size Reached (1.5 MiB)


    -> now, did I screw up something, or are the random_tests crashing from time to time?
    -> PLUS: The random test input arrays are NOT sorted as stated in the instructions.

  • Default User Avatar

    Thank you. That is way more pleasing to my eyes and feeling :)

  • Default User Avatar

    I guess I am quite a bit late, but there is a NOTE about additional white spaces in this Katas' description.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution