Ad
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

    {{}} - array containing 1 empty array.

    ;)

  • Custom 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.

  • Custom User Avatar

    I can prepare a fork with a fix if you want, but I need some time.

  • Custom User Avatar

    using namespace std; is not needed, and in case of this particular C++ translation it actually breaks things. There are some includes missing here and there in the translation, and the problem is that using namespace std; seems to be necessary in solution (but it's not) because it is missing in another place (specifically, in tests).

    This is a valid issue, and code of snippets should be corrected: missing includes should be added, and usings should be added where necessary, and removed where unnecessary.

  • Custom User Avatar

    The "Setup" solution has "using namespace std;". Maybe it is not the best way but it is there and is needed.

  • Custom User Avatar

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

  • Custom 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.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom 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.

  • Custom User Avatar

    Not a kata suggestion!

  • Custom User Avatar

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

  • Loading more items...