C++ notes for PS

This is my notes for problem solving in c++, that I’ve learned while coding in C++ and found them helpful.

convert string to lowercase.


check this character is alpha.


check the character is in upper case


Import all libs


copy contents of deque of chars into string

std::string ss(dqu.begin(),dqu.end());

Modulo of a negative number [Example]

(?n)%k == (k?(n%k))%k

Find substring

std::size_t zero7 = s.find("0000000"); if(zero7!=std::string::npos) found=true;