Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chan9yu/algorithm-playground
βπΌ algorithm playground repository
https://github.com/chan9yu/algorithm-playground
algorithm bfs-algorithm dfs-algorithm dynamic-programming javascript sorting-algorithms
Last synced: 1 day ago
JSON representation
βπΌ algorithm playground repository
- Host: GitHub
- URL: https://github.com/chan9yu/algorithm-playground
- Owner: chan9yu
- Created: 2021-12-16T13:49:13.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-20T13:57:05.000Z (4 months ago)
- Last Synced: 2024-12-11T18:17:34.404Z (about 2 months ago)
- Topics: algorithm, bfs-algorithm, dfs-algorithm, dynamic-programming, javascript, sorting-algorithms
- Language: JavaScript
- Homepage:
- Size: 149 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π§π»βπ» Algorithm Playground
> 곡λΆν΄μΌν΄μ γ γ ...
## μκ³ λ¦¬μ¦ μ 리
- [λμ κ³νλ²(DP, Dynamic Programming)](https://github.com/chan9yu/algorithm-playground/blob/main/note/dynamic_programming.md)
## fs λͺ¨λμ μ΄μ©νλ λ°©λ²
### λ°±μ€ μ μΆμ©
1. ν μ€λ‘ μ λ ₯μ λ°μ λ
```js
const fs = require("fs");
const input = fs.readFileSync("/...").toString().split(" ");const num = Number(input);
for (let i = 1; i <= num; i++) {
console.log(i);
}
```2. μ¬λ¬ μ€λ‘ μ λ ₯μ λ°μ λ
```js
const fs = require("fs");
const input = fs.readFileSync("/...").toString().split("\n");
const numbers = [];for (let i = 1; i < input.length; i++) {
if (input[i] !== "") {
numbers.push(input[i].split(" "));
}
}for (let i = 0; i < numbers.length; i++) {
let num1 = Number(numbers[i][0]);
let num2 = Number(numbers[i][1]);
console.log(num1 + num2);
}
```