3
vector<string> removeComments(vector<string> &source) {6
bool comm = false; // it will help us see whether comment is active or not8
for (string s : source) {9
for (int j = 0; j < s.size(); j++) {10
// that means a comment is started11
if (!comm && s[j] == '/' && s[j + 1] == '*') {15
// what if a // <- is present, then full line is not read & break16
// also make sure it is outside comments17
else if (!comm && s[j] == '/' && s[j + 1] == '/')19
// check if a comment is completed20
else if (comm && s[j] == '*' && s[j + 1] == '/') {24
// or else it is a valid code28
// now check if it's a comment or not and its not blank (because comments29
// are blank lines) and add it to output31
if (!comm && cur.size()) {