Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6f3a9c5

Browse files
solve: 커피 심부름
1 parent 8dbe8e7 commit 6f3a9c5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

‎Level0/PRO181837.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Solution 1
2+
const PRICE_TAGS = Object.freeze({
3+
anything: 4500,
4+
americano: 4500,
5+
cafelatte: 5000,
6+
});
7+
8+
const removeIceAndHotText = (order) => {
9+
return order.replace('ice', '').replace('hot', '');
10+
};
11+
12+
const solution = (orderList) => {
13+
return orderList.reduce((acc, order) => acc + PRICE_TAGS[removeIceAndHotText(order)], 0);
14+
};

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,3 +307,4 @@
307307
| 23.12.01. | `Level 0` | [이차원 배열 대각선 순회하기](https://school.programmers.co.kr/learn/courses/30/lessons/181829) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181829.js) |
308308
| 23.12.03. | `Level 0` | [수열과 구간 쿼리 4](https://school.programmers.co.kr/learn/courses/30/lessons/181922) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181922.js) |
309309
| 23.12.05. | `Level 0` | [등차수열의 특정한 항만 더하기](https://school.programmers.co.kr/learn/courses/30/lessons/181931) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181931.js) |
310+
| 23.12.09. | `Level 0` | [커피 심부름](https://school.programmers.co.kr/learn/courses/30/lessons/181837) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181837.js) |

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /