Improved algorithm by removing empty letters during pop, not later
Improved performance by recalculating first/last letter only by request
Added DEBUG_OUTPUT macro - tired of commenting/uncommenting debugging output to stdout
Use bit array instead of hashset for greedy pairs result