Skip to content

Latest commit

 

History

History
121 lines (47 loc) · 1.11 KB

Week7.md

File metadata and controls

121 lines (47 loc) · 1.11 KB

core-code-from-Elvin-Rueda

Monday

1. Input/Output

Confirm Input

Input

Select Input

Input

Single Input

Input

2. Readme - OOP

Solution:

Tuesday

1. Menu

Solution:

2. Movies

Solution:

Wednesday

2. Build Tower Exercise

Solution:

export const towerBuilder = (nFloors: number): string[] => {
 let array = [];
 for (let i = nFloors; i >= 1; i--) {
   let space = (nFloors - i);
   let stars = i * 2 - 1;
   array.push(" ".repeat(space) + "*".repeat(stars) + " ".repeat(space));
 }
 return array.reverse();
}

3. Meeting Exercise

Solution:

export function meeting(s: string): string {
  return s
   .split(';')
   .map((el) => '(' + el.split(':').reverse().join(', ').toUpperCase() + ')')
   .sort()
   .join('');
}