3 ms·
You can shorten the loop to just tree conditionals: while (c = *input++) { if (c == 's') r++; if (c == 'p') r--; }
by MisterTea 3y ago
You can shorten the loop to just tree conditionals:
while (c = *input++) {
if (c == 's') r++;
if (c == 'p') r--;
}