Norway


#include <iostream>

#include <string>

#include <algorithm>

using namespace std;

 

// Function to remove characters from a string that are not present in

// the specified pattern

void removeChars(string& s, const string& allowed) {

    s.erase(remove_if(s.begin(), s.end(), [&allowed](const char& c) {

        return allowed.find(c) == string::npos;

    }), s.end());

}

 

// Function to remove the adjacent duplicates from the given string

void removeDuplicates(string &s) {

    char prev =

No tags for this post.

LEAVE A REPLY

Please enter your comment!
Please enter your name here