알고리즘
-
알고리즘 (230901-1)알고리즘 2023. 9. 1. 15:21
사고를 넓히기 위해서 기초적인것부터 심화까지 알고리즘 문제를 풀어보아야겠다 # 문제 - 345와 456이 입력값으로 들어올때 아래의 1,2,3,4를 구하시오. 345 x456 ------ 2070 --- 1 1725 --- 2 13870 --- 3 ------------ 157320 --- 4 # 풀이 function solution(x,y){ const strB = String(y) let b = Array.from(strB) //['4','5','6'] b_1 = b[2] //6 b_2 = b[1] //5 b_3 = b[0] //4 console.log(Number(x) * Number(b_1)) console.log(Number(x) * Number(b_2)) console.log(Number(x)..