export const towerBuilder = (nFloors: number): string[] => {

  const floors: string[] = [];

  for (let n = 1; n < nFloors + 1; n++) {
    const stars = "*".repeat(n * 2 - 1);
    const space = ' '.repeat(nFloors - n);
    const res = space + stars + space;
    floors.push(res);
  }

  return floors;

}

console.log(towerBuilder(3))
console.log(towerBuilder(6))
