Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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
include
s 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 thatbit/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.Should be part of "algorithm" I think. Not sure how it used to work.
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.