Join up the vector to be one string.
Take a look at the examples.
using namespace std;
string Jointup(vector<string> name , char symbol = ", "){
string result;
for(int i = 0 ; i < name.size() ; i++ )
{
result += name[i];
if(i != name.size() - 1)
{
result+= symbol;
}
}
return result;
}
Describe(JointUp)
{
It(Should_Join_Up)
{
Assert::That({"Adam","The" , "Best"}, Equals({"Adam , The , Best"}));
}
};
Basically, you should order the numbers in order to greatest.
DONT USE THE SORTING FUNCTION!!!
If the numbers are ordered correctly the function should return true , if not return false.
Take a look at the examples
Good luck
using namespace std;
int Ordering(vector<int> num) //1,0,3
{
vector <int> result;
for(int i = 0 ; i < num.size() ; i++)
{
sort(num.begin() , num.end());
result.push_back(num[i]);
}
return result;
}
// TODO: Replace examples and use TDD by writing your own tests
Describe(Ordering)
{
It(Order_To_Greatest)
{
Assert::That({1,2,3,4,5}, Equals({1,2,3,4,5}));
Assert::That({2,1,3,4,5}, Equals({1,2,3,4,5})
}
};