Comments (4)
@Woohwahwa
커밋 시간을 보고 입을 벌려보아요~!!
문제에서 테스트 같은 단어가 등장하는데 성화가 작업할때도 같은 결과가 나오나요???
const rl = require('readline').createInterface(process.stdin)
let count
const set = new Set()
rl.on('line', line => {
if (!count) {
count = +line
} else {
set.add(line)
if (!--count) {
const list = [...set]
list.sort((s1, s2) => (s1.length - s2.length) || s1.localeCompare(s2))
console.log(list.join('\n'))
}
}
})
localeCompare
을 활용한 코드인데 살펴보아요~~
from baekjoon.
시간될 때 다른 궁금한것도 답을 남겨볼께요~
from baekjoon.
const output = input.sort((a, b) => a.length - b.length || a.localeCompare(b));
const result = Array.from(new Set(output));
console.log(result.join('\n'));
쌤 틀린 이유를 찾았어요! 제가 문제를 똑바로 안 본 나머지 중복 문자를 제거하라는 말을 놓쳤지 모예여..
근데 이번엔 중복 문자를 제거했는데 제출 형식이 잘못되었다고 나와요! node 로 실행했을 때 잘되는데 이유를 모르겠어요;;;
from baekjoon.
const [T, ...input] = require('fs').readFileSync('/dev/stdin').toString().split('\n');
let output = '';
const output = input.sort((a, b) => a.length - b.length || a.localeCompare(b));
const result = Array.from(new Set(output));
console.log(result.join('\n'));
console.log(output);
저 이렇게 돌려봤는데
5
a
bba
bbb
cc
bb
테스트케이스는 위에거!
이렇게 결과가나와요,,,! 무엇을 잘못한걸까요,,
from baekjoon.
Related Issues (14)
- 이제 시작이에요!(1000, 1001, 1002, 1003, 1977, 11098, 5635번 이야기)
- 2948 HOT 1
- 11650, 11656 HOT 5
- 용감한 연습문제 HOT 6
- 다리를 건너는 트럭 HOT 9
- 궁금한 점!! HOT 8
- 1003, 1408, 2748, 5565 HOT 5
- 1408, 10984 HOT 4
- 2010 HOT 6
- 5522 HOT 2
- 1978, 2581, 2609 HOT 8
- 2501, 2562, 2576 HOT 6
- 2455 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baekjoon.