Skip to content

Commit

Permalink
컨트롤 제트
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed May 10, 2023
1 parent 5ef0303 commit b40fd16
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Programmers/exam71.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function solution(s) {
let answer = 0;
array = s.split(" ");
array.forEach((v, index) => {
v !== "Z" ? (answer += Number(v)) : (answer -= array[index - 1]);
});
return answer;
}

0 comments on commit b40fd16

Please sign in to comment.