Skip to content

Contribute

CodePrime is open source, and every page is a plain Markdown file in the GitHub repository. Fixing a typo, improving an explanation and adding a new problem are all welcome.

You need Node.js 22.12 or newer.

Terminal window
git clone https://github.com/umangkumarr/CodePrime.git
cd CodePrime
npm install
npm run dev

The site is then available at http://localhost:4321/CodePrime/ and reloads as you edit.

Create src/content/docs/docs/codes/<problem-slug>.md. The front matter holds the facts; the body holds the explanation. The page header, the “Solve on LeetCode” button, the complexity badges, the topic chips and the spoiler-safe code panel are all generated from it.

---
title: Two Sum
source: https://leetcode.com/problems/two-sum/
difficulty: Easy # optional: Easy | Medium | Hard
tags: [Array, Hash Table]
complexity:
time: O(n)
space: O(n)
---
## Problem
The problem statement (Markdown or HTML).
## Solution approach
### Intuition
### Algorithm
### Complexity
- **Time:** $O(n)$ — why.
- **Space:** $O(n)$ — why.
### Edge cases
## Code
```cpp title="C++"
// solution
```

Two Sum is the reference example. For several languages, rename the file to .mdx and wrap the code blocks in Starlight’s <Tabs syncKey="lang">.

Finally, add the page’s slug to the right group in src/data/sidebar.json.

Create src/content/docs/system-design/case-studies/<name>.md. It appears in the System Design sidebar automatically. Diagrams can be written as Mermaid code blocks:

```mermaid
flowchart LR
Rider --> Gateway --> Dispatch --> Driver
```
  1. Fork the repository and create a branch.
  2. Run npm run build to make sure the site still builds.
  3. Open a pull request describing what you added or changed.