728x90
반응형
1차풀이
function solution(phone_number) {
const num= phone_number.substr(phone_number.length-4 ,4)
let secret = "*".repeat(phone_number.length-4)
return secret + num
}
'🍀 코딩 테스트 > 프로그래머스' 카테고리의 다른 글
LV1 - 이상한 문자 만들기 (0) | 2022.08.09 |
---|---|
LV1 - 수박수박수박수박수박수? (0) | 2022.07.19 |
LV1 - 소수찾기 (0) | 2022.07.18 |
LV1 - 서울에서 김서방 찾기 (0) | 2022.07.16 |
LV1 - 문자열 다루기 기본 (0) | 2022.07.16 |