Skip to content

Commit

Permalink
잘라서 배열로 저장하기
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed May 18, 2023
1 parent 0b2a5c3 commit a07f15b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Programmers/exam76.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function solution(my_str, n) {
let answer = [];
for (let i = 0; i < my_str.length; i += n) {
answer.push(my_str.slice(i, i + n));
}
return answer;
}

0 comments on commit a07f15b

Please sign in to comment.