Skip to content

Instantly share code, notes, and snippets.

View KeshariPiyush24's full-sized avatar
🏠
Working from home

Piyush Keshari KeshariPiyush24

🏠
Working from home
View GitHub Profile
@KeshariPiyush24
KeshariPiyush24 / Notes.md
Created September 21, 2024 10:14
349. Intersection of Two Arrays
@KeshariPiyush24
KeshariPiyush24 / Notes.md
Created September 21, 2024 10:06
Row with max 1s

Question: Row with max 1s

Intution: Not exactly binary search but we can utilize the fact that it the row is sorted. We have to use 2 pointers approach.

Time Complexity: $$O(n + m)$$

Space Complexity: $$O(1)$$

Solution:

@KeshariPiyush24
KeshariPiyush24 / Notes.md
Created September 21, 2024 09:36
Frequency In A Sorted Array
@KeshariPiyush24
KeshariPiyush24 / Notes.md
Created September 21, 2024 08:29
Implement Lower Bound

Question: Implement Lower Bound

Intution:

Time Complexity: $$O(log(n))$$

Space Complexity: $$O(1)$$

Solution:

@KeshariPiyush24
KeshariPiyush24 / Notes.md
Last active September 21, 2024 08:27
Implement Upper Bound

Question: Implement Upper Bound

Intution:

Time Complexity: $$O(log(n))$$

Space Complexity: $$O(1)$$

Solution:

@KeshariPiyush24
KeshariPiyush24 / Notes.md
Created September 21, 2024 05:39
153. Find Minimum in Rotated Sorted Array
@KeshariPiyush24
KeshariPiyush24 / Notes.md
Last active September 21, 2024 05:36
367. Valid Perfect Square
@KeshariPiyush24
KeshariPiyush24 / Notes.md
Created September 21, 2024 05:34
441. Arranging Coins

Question: 441. Arranging Coins

Intution:

Time Complexity: $$O(log(n))$$

Space Complexity: $$O(1)$$

Solution:

@KeshariPiyush24
KeshariPiyush24 / Notes.md
Created September 21, 2024 05:32
744. Find Smallest Letter Greater Than Target
@KeshariPiyush24
KeshariPiyush24 / Notes.md
Created September 21, 2024 05:31
278. First Bad Version

Question: 278. First Bad Version

Intution:

Time Complexity: $$O(log(n))$$

Space Complexity: $$O(1)$$

Solution: