프로그래머스(코딩 테스트)/Lv.0
중복된 숫자 개수
걍가영
2024. 10. 15. 17:49
// javascript
const solution = (array, n) => {
return array.filter(item => item === n).length;
}
// typescript
const solution = (array:number[], n:number):number => {
return array.filter(item => item === n).length;
}