main.cpp:53:9: error: use of undeclared identifier 'queue'
queue<int> q({s});
^
main.cpp:53:18: error: expected '(' for function-style cast or type construction
queue<int> q({s});
~~~^
main.cpp:53:20: error: use of undeclared identifier 'q'
queue<int> q({s});
^
main.cpp:55:16: error: use of undeclared identifier 'q'
while(!q.empty()){
^
main.cpp:56:21: error: use of undeclared identifier 'q'
int u = q.front(); q.pop();
^
main.cpp:56:32: error: use of undeclared identifier 'q'
int u = q.front(); q.pop();
^
main.cpp:61:21: error: use of undeclared identifier 'q'
q.push(e.to);
^
7 errors generated.
Dont relay on includes by user code
This should be also put in the test part
#include<vector>
#include<queue>
using namespace std;
https://www.codewars.com/kata/reviews/5db0c65918d8df0001818183/groups/5dc8b4ab2d55c30001fe5a96
This solution sometimes fails at the "tiny" random tests. A corresponding fixed test should be added.
Fixed
Fixed
The actual tests doesn't seed the RNG with current time so the test cases are actually deterministic.
using namespace std;
is still required in sample tests.Thanks!
Thanks for the feedback, this is my first Kata and I must admit that I don't quite know how this testing stuff really works ^^
Inputs are vulnerable to user functions
Should calculate expected result before sending to user functions
Dont relay on includes by user code
This should be also put in the test part