정리

CS/Data Structure & algorithm

[Algorithm] 백준 4992 - Hanafuda Shuffle (Node / C#)

문제https://www.acmicpc.net/problem/4992 풀이1. Node.js(fs)const fs = require('fs');const input = fs.readFileSync('/dev/stdin').toString().trim().split('\n');let index = 0;while (true) { const [n, r] = input[index++].split(' ').map(Number); if (n === 0 && r === 0) break; let deck = Array.from({length: n}, (_, i) => n - i); for (let i = 0; i  2. Node.js(readLine)const readline = require('..

CS/Data Structure & algorithm

[Algorithm] 백준 4949 - 균형잡힌 세상 (Node / C#)

문제https://www.acmicpc.net/problem/4949풀이1. Node.js(fs)const fs = require('fs');const input = fs.readFileSync('/dev/stdin').toString().trim().split('\n');function isBalanced(str) { const stack = []; const openBrackets = ['(', '[']; const closeBrackets = [')', ']']; const pairs = { ')': '(', ']': '[' }; for (let char of str) { if (openBrackets.includes(char)) { sta..

Programming Language/CSS

[CSS] 텍스트 줄바꿈 / 말줄임 방법 정리

최근 토스에서 Frontend Accelerator 1기를 모집하여, 신청하여 객관식 시험을 볼 수 있었는데,모두 골라야한다는 점이 확실히 알고 있어야하는 것인데, 100% 확신하는가라고 생각했던 문제가 거의 없었던 것 같다.그 중 텍스트 줄바꿈 속성에 관한 문제도 있었어서, 적어보려고 한다.텍스트 줄바꿈 방법 1. white-space  <div class="text-container"> This is a long text that we want to wrap naturally to the next line without breaking words.</div> .text-container { width: 200px; white-space: normal; /* 기본값 */}..

CS/Data Structure & algorithm

[Algorithm] 백준 4889 -안정적인 문자열 (Node / C#)

문제https://www.acmicpc.net/problem/4889 풀이1. Node.js(fs)const fs = require('fs');const input = fs.readFileSync('/dev/stdin').toString().trim().split('\n');const numCases = parseInt(input[0]);function evaluateExpression(expr) { const stack = []; for (let i = 0; i  2. Node.js(readLine)const readline = require('readline');const rl = readline.createInterface({ input: process.stdin, output..