Ad
  • Default User Avatar

    This solution was submitted when a different compiler version and different library versions were used on Codewars. While the concept of modules is gradually introduced in C++, tradicional includes just insert contents of a file into another file. Since some files include other files and some files are included by the testing framework as well, lots of things end up declared in the scope transitively. Then if you rely on things being declared for you, it will break sometime or even already now with just a different compiler. Note that bit/stdc++.h isn't a part of any standard, so if you decide to use it, you should at least know what you're doing.

  • Custom User Avatar

    Should be part of "algorithm" I think. Not sure how it used to work.

  • Default User Avatar

    Just wondering but:
    When I inserted this answer
    into my editor, it came back in error.

    I had to add #include<bit/stdc++.h> for 'count' to work.

    I was wondering why the absence of include didn't effect this answer.

    I am relatively new to C++ as most of my coding experience is in Java.