[D+98] 항해99 11일차(1)

오늘은 알고리즘 테스트 날!

#1번

function solution(phone){
	let result=""
if (phone.length == 10) {
  let first = phone.slice(0,2)
  let second = phone.slice(2,6)
  let third = phone.slice(6,10)
  result = `"0${first}-${second}-${third}"`
}

	return result;
  
}
console.log(solution("1062509911"))

#2번


JavaScript 답안 포맷

function solution(arr1, arr2){
	let answer='';
	return answer;
}
let arr1=["8:42", "9:00", "8:50", "8:47", "9:01", "8:51", "8:59"];
let arr2=["21:42", "23:10", "25:30", "29:10", "23:11", "26:44", "29:26"];
console.log(solution(arr1, arr2))

좋은 웹페이지 즐겨찾기