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.
...And you didn't bother to even change the name of the code blocks.
If you're just straight out copy-pasting a problem along with their test data sets from another OJ site, don't do it. That's a very poor practice (plagiarizing content from other sites are never a good idea), and in CW you need test code that is at least descriptive, informative and has random tests. Which you have done none of.
Besides being a duplicate, the initial code and kata designs needs lots of revise:
#include<stdio.h>
andusing namespace std;
should not be included because they are entirely unnecessary#include<queue>
? Now that's just a spoilerint n,int* a
is a very poor input format for C++ (you're just writing C code in C++ there), please use something actually idiomatic to C++ likeconst std::vector<int> xs
Duplicate: https://www.codewars.com/kata/5b7d7ce57a0c9d86c700014b