@@ -18,23 +18,44 @@ import {
1818
1919const 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 */
2846function 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 = { } ;
0 commit comments