Vishal Chovatiya
Posted on February 11, 2020
I am creating a list of coding problems which I can provide to my juniors to get habitual to using STL algorithm rather writing their own algorithm.
If you have any intuitive coding problem in mind where we can use the STL algorithm efficiently, you will be a great help. Combination of more than one algorithm is also good.
For example: Trim spaces from following string.
int main()
{
string input_string = "1 2 3 4 5 55 5 ";
// Your code
return 0;
}
- Output
12345555
Here we can apply std::unique
, perfectly.
💖 💪 🙅 🚩
Vishal Chovatiya
Posted on February 11, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.