Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js-training/20200316/phoneNumber.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ function solution4(phoneNumber) {
test('sample', () => {
[solution1, solution2, solution3, solution4].forEach(solution => {
expect(solution('01033334444')).toBe('*******4444');
expect(solution('027778888')).toBe('*****8888');
expect(solution('027778888')).toBe('*****8888');
});
});
10 changes: 7 additions & 3 deletions js-training/20200413/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# 자릿수 더하기 문제

[문제 링크](https://programmers.co.kr/learn/courses/30/lessons/12931)

## 문제 설명

자연수 N이 주어지면, N의 각 자릿수의 합을 구해서 return 하는 solution 함수를 만들어 주세요.
예를들어 N = 123이면 1 + 2 + 3 = 6을 return 하면 됩니다.

## 제한사항

N의 범위 : 100,000,000 이하의 자연수

## 입출력 예
N answer
123 6
987 24

| N | answer |
| 123 | 6 |
| 987 | 24 |
6 changes: 3 additions & 3 deletions js-training/20200413/addDigits.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ function solution(number) {
}

test('sample', () => {
expect(solution(123)).toBe(6);
expect(solution(987)).toBe(24);
});
expect(solution(123)).toBe(6);
expect(solution(987)).toBe(24);
});
12 changes: 8 additions & 4 deletions js-training/20200414/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# 문자열 내 p와 y의 개수

[문제 링크](https://programmers.co.kr/learn/courses/30/lessons/12916)

## 문제 설명

대문자와 소문자가 섞여있는 문자열 s가 주어집니다. s에 'p'의 개수와 'y'의 개수를 비교해 같으면 True, 다르면 False를 return 하는 solution를 완성하세요. 'p', 'y' 모두 하나도 없는 경우는 항상 True를 리턴합니다. 단, 개수를 비교할 때 대문자와 소문자는 구별하지 않습니다.

예를 들어 s가 pPoooyY면 true를 return하고 Pyy라면 false를 return합니다.

### 제한사항

문자열 s의 길이 : 50 이하의 자연수
문자열 s는 알파벳으로만 이루어져 있습니다.

## 입출력 예
|s|answer|
|:-|:----|
|pPoooyY|true|
|Pyy|false|

| s | answer |
| :- | :---- |
| pPoooyY | true |
| Pyy | false |
2 changes: 1 addition & 1 deletion js-training/20200414/countLetters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function solution2(letters) {
}

test('sample', () => {
[solution1, solution2].forEach(solution => {
[solution1, solution2].forEach(solution => {
expect(solution('pPoooyY')).toBe(true);
expect(solution('Pyy')).toBe(false);
});
Expand Down
Loading