|
|
|
|
|
by gregod
1950 days ago
|
|
I think the following minor optimizations can further decrease the runtime: * There is no use in first pop()ing a candidate from the "reacts" list and then potentially re-pushing them later. Getting a pointer to the last element, and removing it if it is not needed, is more efficient. * Reordering the character equality condition could help a tiny bit since the inequality check should be faster than the ignore case check. |
|
I think the given ordering is better: in a conjuction, you typically put the less likely condition first, not the cheaper one.