String factorisations with maximum or minimum dimension