nit: spaces around '-': `comps[i] - 1;`