Performance improvements for 150.

TBD
- I've seen shorter and faster implementations...
- Need to try to reduce the code to about 30 lines max.

Notes
- The solution is longer without string manipulations.
- Need to rethink about a shorter and more efficient approach.