Skip to content

Solve : 31-33번 문제 해결 #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2022
Merged
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
9 changes: 9 additions & 0 deletions Challenge/sooyoungCho/031.timeComplexity/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 문제31 : 자바스크립트 자료형의 복잡도

다음 배열 내장함수의 시간 복잡도가 O(1)이 아닌 것을 모두 고르시오.

1) arr[i]
2) arr.push(5)
3) arr.slice()
4) arr.pop()
5) arr.includes(5)
14 changes: 14 additions & 0 deletions Challenge/sooyoungCho/031.timeComplexity/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
# 문제31 : 자바스크립트 자료형의 복잡도

다음 배열 내장함수의 시간 복잡도가 O(1)이 아닌 것을 모두 고르시오.
*/
// arr[i]
// arr.push(5)
arr.slice()
// arr.pop()
arr.includes(5)

// 시간 복잡도 : 알고리즘을 처리하는 데 얼마의 시간이 걸리는지?
// Big-O 표기법
// O(1) : 입력되는 데이터의 크기와 상관없이 알고리즘이 문제를 해결하는 속도가 모두 일정할 때 표기
13 changes: 13 additions & 0 deletions Challenge/sooyoungCho/032.문자열만들기/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 문제32 : 문자열 만들기

취업 준비생인 혜림이는 자기소개서를 쓰고 있습니다. 열심히 자기소개서를 작성하던 도중 혜림이는 자기가 지금까지 단어를 얼마나 적었는지 궁금하게 됩니다.

혜림이를 위해 **문자열을 입력받으면 단어의 갯수를 출력하는 프로그램**을 작성해 주세요.

```jsx
**입력**
안녕하세요. 저는 제주대학교 컴퓨터공학전공 혜림입니다.

**출력**
5
```
16 changes: 16 additions & 0 deletions Challenge/sooyoungCho/032.문자열만들기/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// # 문제32 : 문자열 만들기

// 취업 준비생인 혜림이는 자기소개서를 쓰고 있습니다. 열심히 자기소개서를 작성하던 도중 혜림이는 자기가 지금까지 단어를 얼마나 적었는지 궁금하게 됩니다.

// 혜림이를 위해 문자열을 입력받으면 단어의 갯수를 출력하는 프로그램을 작성해 주세요.

// ```jsx
// **입력**
// 안녕하세요. 저는 제주대학교 컴퓨터공학전공 혜림입니다.

// **출력**
// 5
// ```

const text = prompt('문자열을 입력하세요').split(' ');
console.log(text.length);
13 changes: 13 additions & 0 deletions Challenge/sooyoungCho/033.Reverse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 문제33 : 거꾸로 출력하기

한 줄에 여러개의 숫자가 입력되면, 역순으로 그 숫자들을 하나씩 출력하는 프로그램을 작성하시오.

```jsx
**입출력**
입력 : 1 2 3 4 5
출력 : 5 4 3 2 1

**출력**
입력 : 2 4 6 7 8
출력 : 8 7 6 4 2
```
20 changes: 20 additions & 0 deletions Challenge/sooyoungCho/033.Reverse/solve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// # 문제33 : 거꾸로 출력하기

// 한 줄에 여러개의 숫자가 입력되면, 역순으로 그 숫자들을 하나씩 출력하는 프로그램을 작성하시오.

// ```jsx
// **입출력**
// 입력 : 1 2 3 4 5
// 출력 : 5 4 3 2 1

// **출력**
// 입력 : 2 4 6 7 8
// 출력 : 8 7 6 4 2
// ```

const n = prompt('여러개의 숫자를 입력하세요').split(' ');
let reverse = '';
for(i = 0; i < n.length; i++){
reverse = n[i] + ' ' + reverse;
}
console.log(reverse);