Skip to content

Commit e1ec632

Browse files
committed
Fix default complexity issue and upgraded critical dependency
1 parent 62dcb53 commit e1ec632

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@
109109
"main": "dist-electron/main.js"
110110
}
111111
},
112-
"keywords": ["interview", "coding", "interview prep", "technical interview", "tool"],
112+
"keywords": [
113+
"interview",
114+
"coding",
115+
"interview prep",
116+
"technical interview",
117+
"tool"
118+
],
113119
"author": "Interview Coder Contributors",
114120
"license": "AGPL-3.0-or-later",
115121
"description": "An invisible desktop application to help you pass your technical interviews.",
@@ -170,7 +176,7 @@
170176
"rimraf": "^6.0.1",
171177
"tailwindcss": "^3.4.15",
172178
"typescript": "^5.4.2",
173-
"vite": "^5.1.6",
179+
"vite": "^6.2.5",
174180
"vite-plugin-electron": "^0.28.4",
175181
"vite-plugin-electron-renderer": "^0.14.6",
176182
"wait-on": "^7.2.0"
@@ -187,4 +193,4 @@
187193
"last 1 safari version"
188194
]
189195
}
190-
}
196+
}

src/_pages/Solutions.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,19 @@ export const ComplexitySection = ({
9595
}) => {
9696
// Helper to ensure we have proper complexity values
9797
const formatComplexity = (complexity: string | null): string => {
98-
if (!complexity) return "O(n) - Linear time/space complexity";
99-
98+
// Default if no complexity returned by LLM
99+
if (!complexity || complexity.trim() === "") {
100+
return "Complexity not available";
101+
}
102+
103+
const bigORegex = /O\([^)]+\)/i;
100104
// Return the complexity as is if it already has Big O notation
101-
if (complexity.match(/O\([^)]+\)/i)) {
105+
if (bigORegex.test(complexity)) {
102106
return complexity;
103107
}
104108

105-
// Otherwise, add a default Big O
106-
return `O(n) - ${complexity}`;
109+
// Concat Big O notation to the complexity
110+
return `O(${complexity})`;
107111
};
108112

109113
const formattedTimeComplexity = formatComplexity(timeComplexity);

0 commit comments

Comments
 (0)