Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@
"main": "dist-electron/main.js"
}
},
"keywords": ["interview", "coding", "interview prep", "technical interview", "tool"],
"keywords": [
"interview",
"coding",
"interview prep",
"technical interview",
"tool"
],
"author": "Interview Coder Contributors",
"license": "AGPL-3.0-or-later",
"description": "An invisible desktop application to help you pass your technical interviews.",
Expand Down Expand Up @@ -170,7 +176,7 @@
"rimraf": "^6.0.1",
"tailwindcss": "^3.4.15",
"typescript": "^5.4.2",
"vite": "^5.1.6",
"vite": "^6.2.5",
"vite-plugin-electron": "^0.28.4",
"vite-plugin-electron-renderer": "^0.14.6",
"wait-on": "^7.2.0"
Expand All @@ -187,4 +193,4 @@
"last 1 safari version"
]
}
}
}
14 changes: 9 additions & 5 deletions src/_pages/Solutions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,19 @@ export const ComplexitySection = ({
}) => {
// Helper to ensure we have proper complexity values
const formatComplexity = (complexity: string | null): string => {
if (!complexity) return "O(n) - Linear time/space complexity";

// Default if no complexity returned by LLM
if (!complexity || complexity.trim() === "") {
return "Complexity not available";
}

const bigORegex = /O\([^)]+\)/i;
// Return the complexity as is if it already has Big O notation
if (complexity.match(/O\([^)]+\)/i)) {
if (bigORegex.test(complexity)) {
return complexity;
}

// Otherwise, add a default Big O
return `O(n) - ${complexity}`;
// Concat Big O notation to the complexity
return `O(${complexity})`;
};

const formattedTimeComplexity = formatComplexity(timeComplexity);
Expand Down