Daily Archives: November 2, 2020

lc1641

Assume a, e, i, o, u variables mean the number of elements which starts with a, e, i, o, u. Take below as example, length is 5 now. There are a number of elements which starts with a, e number of elements which starts with e, etc.

When extend the length to 6.

When adding a, a can be added in any elements.

When adding ee can be added in front of elements starting with e, i, o, u.

When adding ii can be added in front of elements starting with iou.

When adding oo can be added in front of elements starting with ou.

When adding uu can be added in front of elements starting with u.

lc1641

The elements are lexical order. This is an important criteria.

link