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.
If as a input parameter we receive a signed int, then there should exist some tests to verify what if we put as input a negative intiger.
Missing "#include " in C++ test cases.
Please, avoid C-Style casting in C++ code
This issue is caused by the test code :)
Please, fix it:
main.cpp:20:21: warning: comparison of integers of different signs: 'int' and 'std::__cxx11::basic_string<char, std::char_traits, std::allocator >::size_type' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < s.size(); i++) setS.insert(s[i]);
~ ^ ~~~~~~~~
1 warning generated.
Please, fix for C++:
main.cpp:26:24: warning: comparison of integers of different signs: 'int' and 'std::__cxx11::basic_string<char, std::char_traits, std::allocator >::size_type' (aka 'unsigned long') [-Wsign-compare]
for(int i = 0; i < y.size(); i++){
~ ^ ~~~~~~~~
1 warning generated.
For C++. I used std::stoi (int) and resolved the kata. After click submit I realized I should return 'long long'. I suggest add some additional test cases for checking proper type :)
Please, fix tests:
main.cpp:75:23: warning: comparison of integers of different signs: 'int' and 'std::array::size_type' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < a.size(); i++) out << a[i] << (i < a.size()-1 ? "," : "");
~ ^ ~~~~~~~~
main.cpp:66:48: note: in instantiation of function template specialization 'operator<<<int, 10>' requested here
cout << start << " - " << end << " : " << expected << endl;
^
main.cpp:75:58: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for (int i = 0; i < a.size(); i++) out << a[i] << (i < a.size()-1 ? "," : "");
~ ^ ~~~~~~~~~~
2 warnings generated.
Please, fix it:
main.cpp:24:21: warning: comparison of integers of different signs: 'int' and 'std::__cxx11::basic_string<char, std::char_traits, std::allocator >::size_type' (aka 'unsigned long') [-Wsign-compare]
for ( int i=0; i<fight.length(); i++)
~^~~~~~~~~~~~~~~
1 warning generated.
Please, fix it warning for C++:
main.cpp:62:30: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for(int i = 0; i < numbers.size() - 1; i++)
~ ^ ~~~~~~~~~~~~~~~~~~
1 warning generated.
(warning from test cases, not my code)
Missing "using namespace std;" for C++ Test samples. Imho you shoudln't force devs to use that in them solutions :) - and the "Test samples" should work right away, without any other action.
Please, fix tests for C++:
main.cpp:25:24: warning: comparison of integers of different signs: 'int' and 'std::__cxx11::basic_string<char, std::char_traits, std::allocator >::size_type' (aka 'unsigned long') [-Wsign-compare]
for(int i = 0; i < drone.size(); i++){
~ ^ ~~~~~~~~~~~~
1 warning generated.
Please fix it for C++ (warning from test code, not mine):
main.cpp:53:30: warning: comparison of integers of different signs: 'int' and 'std::__cxx11::basic_string<char, std::char_traits, std::allocator >::size_type' (aka 'unsigned long') [-Wsign-compare]
for(int i = 0; i < str.size(); i++)
~ ^ ~~~~~~~~~~
1 warning generated.
Something is wrong, I had to add "#include " to avoid:
main.cpp:50:5: error: use of undeclared identifier 'strcpy'
strcpy ( ch_digits , conv_num.c_str());
^
1 error generated.
This comment is hidden because it contains spoiler information about the solution
Loading more items...