Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2c03149
배열 자르기 / 기초
oh-chaeyeon Jan 2, 2025
b307f95
배열 원소의 길이 / 기초
oh-chaeyeon Jan 2, 2025
280b794
배열 회전시키기 / 기초
oh-chaeyeon Jan 2, 2025
2465ff2
중복된 숫자 개수 / 기초
oh-chaeyeon Jan 2, 2025
9b120c8
제일 작은 수 제거하기 / 중급
oh-chaeyeon Jan 2, 2025
e54d44a
행렬의 덧셈 / 중급
oh-chaeyeon Jan 2, 2025
7f618bf
나누어 떨어지는 숫자 배열 / 중급
oh-chaeyeon Jan 2, 2025
121d553
행렬의 곱셈 / 심화
oh-chaeyeon Jan 2, 2025
1c9229c
교점에 별 만들기 / 심화
oh-chaeyeon Jan 2, 2025
865c257
n^2 배열 자르기 / 심화
oh-chaeyeon Jan 2, 2025
ea88f07
String Reversal / 기초
oh-chaeyeon Jan 11, 2025
3f26859
Control Z / 기초
oh-chaeyeon Jan 11, 2025
a8c82b3
Hate English / 기초
oh-chaeyeon Jan 11, 2025
4a4f3f2
String Calculation / 기초
oh-chaeyeon Jan 11, 2025
d30a080
Crane Game / 중급
oh-chaeyeon Jan 11, 2025
a560deb
Valid Parentheses / 중급
oh-chaeyeon Jan 11, 2025
7dadd5d
Dart Game / 중급
oh-chaeyeon Jan 11, 2025
b2fdfc6
Rotate Parentheses / 심화
oh-chaeyeon Jan 11, 2025
e00f4cd
Stock Price / 심화
oh-chaeyeon Jan 11, 2025
9bd1415
Delivery Box / 심화
oh-chaeyeon Jan 11, 2025
92aa4e2
Merge branch 'main' into ohchaeyeon
oh-chaeyeon Jan 11, 2025
8b3840d
순서쌍의 개수 / 기초
oh-chaeyeon Jan 16, 2025
071e7cc
점의 위치 구하기 / 기초
oh-chaeyeon Jan 16, 2025
5b02168
로그인 성공? / 기초
oh-chaeyeon Jan 16, 2025
a358d28
특이한 정렬 / 기초
oh-chaeyeon Jan 16, 2025
d0819a1
카드 뭉치 / 중급
oh-chaeyeon Jan 18, 2025
420da51
공원 산책 / 중급
oh-chaeyeon Jan 18, 2025
f4bc768
햄버거 만들기 / 중급
oh-chaeyeon Jan 18, 2025
c6c4400
Merge branch 'main' into ohchaeyeon
oh-chaeyeon Jan 18, 2025
5815b69
모스부호1 / 기초
oh-chaeyeon Jan 27, 2025
474e842
A로 B만들기 / 기초
oh-chaeyeon Jan 27, 2025
c726708
진로 순서 정하기 / 기초
oh-chaeyeon Jan 27, 2025
e30e7d6
등수 매기기 / 기초
oh-chaeyeon Jan 27, 2025
a8d94b1
완주하지 못한 선수 / 중급
oh-chaeyeon Jan 27, 2025
e27c3a9
포켓몬 / 중급
oh-chaeyeon Jan 27, 2025
d2301ff
추억 점수 / 중급
oh-chaeyeon Jan 27, 2025
16b93e3
할인 행사 / 심화
oh-chaeyeon Jan 27, 2025
4b3f8ee
오픈채팅방 / 심화
oh-chaeyeon Jan 27, 2025
947ecc7
Merge branch 'main' into ohchaeyeon
oh-chaeyeon Jan 27, 2025
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
5 changes: 5 additions & 0 deletions oh-chaeyeon/4주차_해시/A로_B_만들기.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function solution(before, after) {
return before.split("").sort().join("") === after.split("").sort().join("")
? 1
: 0;
}
6 changes: 6 additions & 0 deletions oh-chaeyeon/4주차_해시/등수_매기기.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function solution(score) {
const averages = score.map((s) => (s[0] + s[1]) / 2);
const sortedAverages = [...averages].sort((a, b) => b - a);

return averages.map((avg) => sortedAverages.indexOf(avg) + 1);
}
34 changes: 34 additions & 0 deletions oh-chaeyeon/4주차_해시/모스부호1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
function solution(letter) {
const morse = {
".-": "a",
"-...": "b",
"-.-.": "c",
"-..": "d",
".": "e",
"..-.": "f",
"--.": "g",
"....": "h",
"..": "i",
".---": "j",
"-.-": "k",
".-..": "l",
"--": "m",
"-.": "n",
"---": "o",
".--.": "p",
"--.-": "q",
".-.": "r",
"...": "s",
"-": "t",
"..-": "u",
"...-": "v",
".--": "w",
"-..-": "x",
"-.--": "y",
"--..": "z",
};
return letter
.split(" ")
.map((code) => morse[code])
.join("");
}
22 changes: 22 additions & 0 deletions oh-chaeyeon/4주차_해시/오픈채팅방.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function solution(record) {
const nicknames = {};
const result = [];

record.forEach((entry) => {
const [action, userId, nickname] = entry.split(" ");
if (action !== "Leave") {
nicknames[userId] = nickname;
}
});

record.forEach((entry) => {
const [action, userId] = entry.split(" ");
if (action === "Enter") {
result.push(`${nicknames[userId]}님이 들어왔습니다.`);
} else if (action === "Leave") {
result.push(`${nicknames[userId]}님이 나갔습니다.`);
}
});

return result;
}
12 changes: 12 additions & 0 deletions oh-chaeyeon/4주차_해시/완주하지_못한_선수.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function solution(participant, completion) {
const count = participant.reduce((acc, name) => {
acc[name] = (acc[name] || 0) + 1;
return acc;
}, {});

completion.forEach((name) => {
count[name]--;
});

return Object.keys(count).find((name) => count[name] > 0);
}
5 changes: 5 additions & 0 deletions oh-chaeyeon/4주차_해시/진로_순서_정하기.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function solution(emergency) {
return emergency.map(
(e) => [...emergency].sort((a, b) => b - a).indexOf(e) + 1
);
}
8 changes: 8 additions & 0 deletions oh-chaeyeon/4주차_해시/추억_점수.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function solution(name, yearning, photo) {
return photo.map((p) =>
p.reduce((sum, person) => {
const index = name.indexOf(person);
return sum + (index !== -1 ? yearning[index] : 0);
}, 0)
);
}
6 changes: 6 additions & 0 deletions oh-chaeyeon/4주차_해시/폰켓몬.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function solution(nums) {
const newNum = [...new Set(nums)];
const selection = nums.length / 2;

return Math.min(newNum.length, selection);
}
24 changes: 24 additions & 0 deletions oh-chaeyeon/4주차_해시/할인_행사.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function solution(want, number, discount) {
const required = {};
want.forEach((item, index) => {
required[item] = number[index];
});

let day = 0;

for (let i = 0; i <= discount.length - 10; i++) {
const current = {};

for (let j = i; j < i + 10; j++) {
current[discount[j]] = (current[discount[j]] || 0) + 1;
}

const isValid = want.every(
(item) => (current[item] || 0) >= required[item]
);

if (isValid) day++;
}

return day;
}
Loading