Skip to content

1181 retry(1) #45

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 14 commits into from
Sep 10, 2024
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
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/issue---🧠algorithm---algorithm-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "Issue : \U0001F9E0Algorithm - Algorithm Type"
about: 알고리즘 공부한 개념을 위한 issue
title: "Issue : \U0001F9E0Algorithm - Algorithm Type"
labels: ''
assignees: 4BFC

---

## 🧠Algorithm - Algorithm Type
- 🧠

## Reference
<details>
<summary><b>🔗 Link</b></summary>
🔗 [알고리즘 이름](https://# "알고리즘 이름/종류")
</details>

## Description
- 학습한 알고리즘을 설명.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-number.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ assignees: 4BFC

## 🌐문제 링크
🔗 [문제번호](https://# "baekjoon 문제번호")
> 참고자료
🔗 [참고자료](https:# "참고자료")

## 📌Point
- 오류 원인을 찾아내고 문제 해결
8 changes: 6 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## #️⃣ Number

- problem Number
- T/No.N

## 🏆정답여부

Expand All @@ -9,12 +10,15 @@
## 🌐문제 링크

🔗 [문제번호](https://# "baekjoon 문제번호")
> 참고자료
🔗 [1931 참고자료](https://yong-nyong.tistory.com/21 "1931 참고자료")

## 🔐풀이 과정

> 🔥Point
문제를 접근한 방식을 적어주세요.
- 풀이과정을 적어 주세요.

## 📌Point
## 📌Description

- 구체적인 풀이 과정을 적어 주세요.

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
- main은 기본 세팅이 되어 있기 때문에 pr이나 외부 push가 이루어져선 안된다.
- recently
- 최근 풀어본 문제가 담겨 있는 브렌치다.
- problem Number(ex. 2557)
- 내가 풀고 있는 문제이다. 브렌치는 문제 번호이다.
- problem Number retry(N)(ex. 2557 retry(N))
- 내가 **다시** 풀고 있는 문제이다. 브렌치는 문제 번호와 retry 횟수이다.

---

Expand Down Expand Up @@ -71,3 +75,6 @@
```

</details>

## Big O fucntion Graph
![image](https://github.com/user-attachments/assets/42754ed9-4029-49ee-bcea-673aa915efd0)
20 changes: 14 additions & 6 deletions javascript/source/dev/stdin
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
5
5
2
3
4
1
13
but
i
wont
hesitate
no
more
no
more
it
cannot
wait
im
yours
34 changes: 15 additions & 19 deletions javascript/source/printer.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
let path = require('path');
let inputPath = path.join(__dirname, '/dev/stdin'); // __dirname은 현재 스크립트의 디렉토리 절대경로
let input = require('fs').readFileSync(inputPath).toString().split('\n');
//let input = require('fs').readFileSync('/dev/stdin').toString().split('\n'); //백준 제출
console.log(input);
let input = require('fs').readFileSync(inputPath).toString().trim().split('\r\n');
//let input = require('fs').readFileSync('/dev/stdin').toString().trim().split('\n'); //백준 제출
let N = input.shift();
let arr = [... new Set(input)];

let arr = [];
for (let i = 0; i < input.length; i++) {
if (!arr.includes(input[i])) {
arr.push(input[i]);
//BFAL
// new Set
// localCompare
arr.sort((a, b) => {
// return a.length - b.length;
if (a.length === b.length) {
return a.localeCompare(b);
} else {
return a.length - b.length;
}
}
});

for (let i = 0; i < arr.length; i++) {
for (let j = 0; j < arr.length; j++) {
//for (let j = 0; j < arr.length - 1 - i; j++) { // 내부 반복문에서 비교 범위 감소
if (arr[j] > arr[j + 1]) {
[arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];
}
}
}

console.log(arr);
arr.forEach(element => console.log(element));
arr.forEach(el => console.log(el))