Skip to content

Commit 0c97960

Browse files
authored
Merge pull request #37 from DaleStudy/feat/34-blind-75-categories
feat: ๋ฌธ์ œ ํ’€์ด ํ˜„ํ™ฉ์„ Blind Top 75 10๊ฐœ ์นดํ…Œ๊ณ ๋ฆฌ๋กœ ์ถ•์†Œ (#34)
2 parents a661cde + 8fd5a30 commit 0c97960

2 files changed

Lines changed: 31 additions & 7 deletions

File tree

โ€Žhandlers/learning-status.jsโ€Ž

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,44 @@ import {
1818

1919
const MAX_FILE_SIZE = 15000; // 15K ๋ฌธ์ž ์ œํ•œ (OpenAI ํ† ํฐ ์•ˆ์ „์žฅ์น˜)
2020

21+
// Blind Top 75 ํ๋ ˆ์ด์…˜ ์ˆœ์„œ โ€” ๋™๋ฅ  ์ •๋ ฌ์˜ ํƒ€์ด๋ธŒ๋ ˆ์ด์ปค๋กœ ์‚ฌ์šฉ.
22+
// ์ถœ์ฒ˜: https://www.teamblind.com/post/new-year-gift-curated-list-of-top-75-leetcode-questions-to-save-your-time-oam1oreu
23+
const BLIND_CATEGORY_ORDER = [
24+
"Array",
25+
"Binary",
26+
"Dynamic Programming",
27+
"Graph",
28+
"Interval",
29+
"Linked List",
30+
"Matrix",
31+
"String",
32+
"Tree",
33+
"Heap",
34+
];
35+
2136
/**
22-
* ์นดํ…Œ๊ณ ๋ฆฌ๋ณ„๋กœ ๋ˆ„์  ํ’€์ด ์ง„ํ–‰๋„๋ฅผ ๊ณ„์‚ฐํ•œ๋‹ค.
37+
* Blind Top 75 ์นดํ…Œ๊ณ ๋ฆฌ๋ณ„๋กœ ๋ˆ„์  ํ’€์ด ์ง„ํ–‰๋„๋ฅผ ๊ณ„์‚ฐํ•œ๋‹ค.
38+
*
39+
* `problem-categories.json` ์˜ ๊ฐ ๋ฌธ์ œ์— ํฌํ•จ๋œ `blindCategories` ํ•„๋“œ๋ฅผ
40+
* ๊ธฐ์ค€์œผ๋กœ Blind 10๊ฐœ ์นดํ…Œ๊ณ ๋ฆฌ๋งŒ ์ง‘๊ณ„ํ•œ๋‹ค (์ด์Šˆ #34).
2341
*
2442
* @param {object} categories - problem-categories.json ์ „์ฒด ์˜ค๋ธŒ์ ํŠธ
2543
* @param {string[]} solvedProblems - ์‚ฌ์šฉ์ž๊ฐ€ ํ’€์ดํ•œ ๋ฌธ์ œ ์ด๋ฆ„ ๋ฐฐ์—ด
2644
* @returns {Array<{ category: string, solved: number, total: number, difficulties: string }>}
2745
*/
2846
function buildCategoryProgress(categories, solvedProblems) {
2947
const solvedSet = new Set(solvedProblems);
30-
const categoryMap = new Map();
48+
const categoryMap = new Map(
49+
BLIND_CATEGORY_ORDER.map((cat) => [
50+
cat,
51+
{ total: 0, solved: 0, solvedDifficulties: [] },
52+
])
53+
);
3154

3255
for (const [problemName, info] of Object.entries(categories)) {
33-
for (const cat of info.categories) {
34-
if (!categoryMap.has(cat)) {
35-
categoryMap.set(cat, { total: 0, solved: 0, solvedDifficulties: [] });
36-
}
56+
for (const cat of info.blindCategories) {
3757
const entry = categoryMap.get(cat);
58+
if (!entry) continue;
3859
entry.total++;
3960
if (solvedSet.has(problemName)) {
4061
entry.solved++;
@@ -48,7 +69,9 @@ function buildCategoryProgress(categories, solvedProblems) {
4869
const ratioA = a[1].total > 0 ? a[1].solved / a[1].total : 0;
4970
const ratioB = b[1].total > 0 ? b[1].solved / b[1].total : 0;
5071
if (ratioB !== ratioA) return ratioB - ratioA;
51-
return a[0].localeCompare(b[0]);
72+
return (
73+
BLIND_CATEGORY_ORDER.indexOf(a[0]) - BLIND_CATEGORY_ORDER.indexOf(b[0])
74+
);
5275
})
5376
.map(([cat, data]) => {
5477
const diffCounts = {};

โ€Žtests/subrequest-budget.test.jsโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ describe("subrequest ์˜ˆ์‚ฐ โ€” ํ•ธ๋“ค๋Ÿฌ๋ณ„ invocation (๋ณ€๊ฒฝ ํŒŒ์ผ 5๊ฐœ)", (
118118
{
119119
difficulty: "Easy",
120120
categories: ["Array"],
121+
blindCategories: ["Array"],
121122
intended_approach: "Two Pointers",
122123
},
123124
])

0 commit comments

Comments
ย (0)