What do you want to save?
Add Code snippet
New code examples
-
C++ 2021-11-06 23:05:07
how to erase element from multiset c++
#include <iostream> #include <set> int main() { std::multiset<int>ms; ms.insert(1); ms.insert(1); ms.insert(2); ms.insert(2); ms.insert(3); ms.insert(3); for(auto& it : ms) { std::cout<<it<<' '; ... Add solution -
C++ 2021-09-29 13:12:05
what do you mean by smallest anagram of a string
#include<iostream> #include<algorithm> using namespace std; int main(){ string s,p; int t; cin>>t; while(t--){ int j=0,i=0; cin>>s>>p; while (i<s.length()) { if(p[j]==s[i]){ s.erase(s.begin()+i); j++; ... Add solution -
C++ 2021-09-18 18:40:04
set in cpp
#include <bits/stdc++.h> #include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; //set mentains internally the ascending order of these numbers void setDemo() { set<int> S; S.in... Add solution -
C++ 2021-09-11 02:47:03
strip whitespace c++
#include <algorithm> #include <cctype> #include <locale> // trim from start (in place) static inline void ltrim(std::string &s) { s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) { return !std::i... Add solution