Share a single object instance across many usages of the same intrinsic state (here, a rendered character) instead of allocating a fresh one every time — a text editor shouldn't create a million distinct 'a' glyph objects for a million 'a' characters.
Implement `GlyphFactory.get(char)`: return the cached Glyph for that character, creating and caching it only the first time it's seen.
solve(text) renders every character through the factory and returns { rendered, uniqueGlyphs } — the cache size proves reuse.
solve('aab') → { rendered: '<a><a><b>', uniqueGlyphs: 2 } — two 'a's share one Glyph.
Sample tests