Given two strings:
This is not a difficult process. Split the strings into characters, use a couple of hashes or arrays to accumulate the counts. Iterate those and perform the subtractions. Sum the differences.
But I need to do this many times, so doing it efficiently is critical. No code to avoid influencing the creativity. Suggestions?
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |