diff --git a/documentation/blog/2024-08-07-two-sum-explain.md b/documentation/blog/2024-08-07-two-sum-explain.md
new file mode 100644
index 0000000..8894732
--- /dev/null
+++ b/documentation/blog/2024-08-07-two-sum-explain.md
@@ -0,0 +1,118 @@
+---
+title: Two Sum Explained
+description: DSA problem two sum explained
+slug: two-sum
+authors: AkashSingh3031
+tags: [Array, LeetCode]
+is_featured: false
+image: https://miro.medium.com/v2/resize:fit:1400/1*2x-CAwfeui5YM4148VxgRA.jpeg
+hide_table_of_contents: false
+---
+
+## PrepVerse | Three Approaches to Solving the Two Sum Problem
+
+### Approach 1: Brute Force
+
+**Algorithm:**
+
+The brute force approach is straightforward. Loop through each element `x` in the array and check if there is another element that equals `target - x`.
+
+**Implementation:**
+
+
+
+
+```python title="Brute Force"
+def two_sum_brute_force(nums, target):
+ n = len(nums)
+ for i in range(n):
+ for j in range(i + 1, n):
+ if nums[i] + nums[j] == target:
+ return [i, j]
+ return None
+```
+
+
+
+
+**Complexity Analysis:**
+
+- **Time Complexity:** O(n²)
+ - For each element, we loop through the rest of the array to find its complement, resulting in O(n) operations per element. Hence, the overall time complexity is O(n²).
+- **Space Complexity:** O(1)
+ - The space required does not depend on the size of the input array, so only constant space is used.
+
+### Approach 2: Two-pass Hash Table
+
+**Intuition:**
+
+To improve our runtime complexity, we need a more efficient way to check if the complement exists in the array. A hash table is well-suited for this purpose because it supports fast lookups in near constant time. By trading space for speed, we can reduce the lookup time from O(n) to O(1).
+
+**Algorithm:**
+
+1. In the first iteration, add each element's value as a key and its index as a value to the hash table.
+2. In the second iteration, check if each element's complement (target - nums[i]) exists in the hash table. If it does, return the current element's index and its complement's index.
+
+**Implementation:**
+
+
+
+
+```python title="Two-pass Hash Table"
+def two_sum_two_pass_hash_table(nums, target):
+ hash_table = {}
+ for i, num in enumerate(nums):
+ hash_table[num] = i
+
+ for i, num in enumerate(nums):
+ complement = target - num
+ if complement in hash_table and hash_table[complement] != i:
+ return [i, hash_table[complement]]
+ return None
+```
+
+
+
+
+**Complexity Analysis:**
+
+- **Time Complexity:** O(n)
+ - We traverse the list containing `n` elements exactly twice. Since the hash table reduces the lookup time to O(1), the overall time complexity is O(n).
+- **Space Complexity:** O(n)
+ - The extra space required depends on the number of items stored in the hash table, which stores exactly `n` elements.
+
+### Approach 3: One-pass Hash Table
+
+**Algorithm:**
+
+We can optimize further by performing the lookup and insertion in a single pass. While iterating through the array, we check if the current element's complement already exists in the hash table. If it does, we have found a solution and return the indices immediately.
+
+**Implementation:**
+
+
+
+
+```python title="One-pass Hash Table"
+def two_sum_one_pass_hash_table(nums, target):
+ hash_table = {}
+ for i, num in enumerate(nums):
+ complement = target - num
+ if complement in hash_table:
+ return [hash_table[complement], i]
+ hash_table[num] = i
+ return None
+```
+
+
+
+
+**Complexity Analysis:**
+
+- **Time Complexity:** O(n)
+ - We traverse the list containing `n` elements only once. Each lookup in the table costs only O(1) time.
+- **Space Complexity:** O(n)
+ - The extra space required depends on the number of items stored in the hash table, which stores at most `n` elements.
+
+### Conclusion
+
+In summary, the brute force approach is simple but inefficient, with a time complexity of O(n²). The two-pass hash table approach improves the time complexity to O(n) by utilizing extra space for a hash table. The one-pass hash table approach further optimizes the solution by combining lookup and insertion into a single pass, maintaining an overall time complexity of O(n) and space complexity of O(n). Depending on the constraints and requirements of your problem, choosing the right approach can significantly improve performance.
\ No newline at end of file
diff --git a/documentation/sidebars.js b/documentation/sidebars.js
index 0aecaed..a36357a 100644
--- a/documentation/sidebars.js
+++ b/documentation/sidebars.js
@@ -27,7 +27,7 @@ module.exports = {
},
{
type: "link",
- href: "/prepverse-community",
+ href: "https://prepverse.vercel.app/prepverse-community",
label: "Prepverse Community",
className: "enterprise-badge",
},
diff --git a/documentation/src/assets/nav-menu.ts b/documentation/src/assets/nav-menu.ts
index bbc3d7a..a087a2f 100644
--- a/documentation/src/assets/nav-menu.ts
+++ b/documentation/src/assets/nav-menu.ts
@@ -21,7 +21,7 @@ export const POPOVERMENUS: NavMenu[] = [
{
label: "Documents",
description: "Everything you need to get started",
- link: "/docs/",
+ link: "https://prepverse.vercel.app/docs/",
icon: DocumentsIcon,
},
{
@@ -103,7 +103,7 @@ export const POPOVERMENUS: NavMenu[] = [
{
label: "About Us",
description: "My information",
- link: "/AkashSingh3031",
+ link: "https://prepverse.vercel.app/AkashSingh3031/",
icon: AboutUsIcon,
},
// {
diff --git a/documentation/src/pages/index.tsx b/documentation/src/pages/index.tsx
index e4b5581..409889b 100644
--- a/documentation/src/pages/index.tsx
+++ b/documentation/src/pages/index.tsx
@@ -21,7 +21,7 @@ function Home() {
diff --git a/documentation/src/prepverse-theme/about-section/edu-exp.tsx b/documentation/src/prepverse-theme/about-section/edu-exp.tsx
index 96c02d3..ccdd4f5 100644
--- a/documentation/src/prepverse-theme/about-section/edu-exp.tsx
+++ b/documentation/src/prepverse-theme/about-section/edu-exp.tsx
@@ -210,7 +210,64 @@ const Experience = ({ className }: { className?: string }) => {
"font-semibold",
)}
>
- Feb 2023 — Present (1 year)
+ Feb 2023 — Present
+
+