Ad
  • Default User Avatar

    Don't undertand your logic. How iterator type depends on position of smallest in array?

  • Default User Avatar

    In C++ and, as I see in comments, some other languages happens critical difference between w / (h * h) and w / h / h due to float point calculation specificity. While both are legit solutions.

    Generally, good practice in this case when testing float point numbers is to allow some less precision than provides FP types of language. f.e. 0.0001

  • Default User Avatar

    Look at begining of your function. Empty array is {}

    {{}} - array containing 1 empty array.

    ;)

  • Default User Avatar

    I can prepare a fork with a fix if you want

    I've already solved it anyway. But sure forthcoming users will appreciate your work.

  • Default User Avatar

    C++ - does not work when removed using namespace std

  • Default User Avatar

    Which is better than brute force O(n^2)

    Not so easy. long long type have a limited size and hence n won't be too big. Also in "brute force" method you can make cheap iteration, especially by avoiding insert and erase string functions.

  • Default User Avatar

    Numeration from 1 is bad idea, because formulas for faster calculation requires numeration from 0

  • Default User Avatar

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

  • Default User Avatar

    Why not? Me, and as I see, some people in comments stumble at this point.

    So I guess it would be good to warn about this moment. And - if possibe - to upgrade test ceses.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    C++: please don't put function declaration in test cases - user can't change types of arguments.

  • Default User Avatar

    Another example of good math trolling :)))

  • Default User Avatar

    C++ : is it so hard was give to helper function another name?

  • Default User Avatar

    I've passed all tests except random with results:

    Expected: false
    Actual : true

    That's not too much clear. In most katas we can make debug output of incoming data, but here incoming data is the expression itsels.

    Then question: how can I see the case I failed on?

  • Loading more items...