[D+98]航海9911日目(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))