프로그래머스(코딩 테스트)/Lv.0
짝수는 싫어요
걍가영
2024. 10. 15. 19:30

// javascript
const solution = (n) => {
return Array.from({length:Math.ceil(n / 2)}, (_, index) => index * 2 + 1)
}
// typescript
const solution = (n:number[]):number[] => {
return Array.from({length:Math.ceil(n / 2)}, (_, index) => index * 2 + 1)
}