kartikcode's

466 posts

kartikcode's banner
kartikcode's

kartikcode's

@Kartscode

👨‍💻 Engineering | Java , Js 💥 💻 Problem Solver ✨ Learning. Building. Breaking. Rebuilding.

India Beigetreten Mayıs 2022
88 Folgt102 Follower
Angehefteter Tweet
kartikcode's
kartikcode's@Kartscode·
✨💪🏻
kartikcode's tweet media
QME
3
0
13
2.9K
kartikcode's
kartikcode's@Kartscode·
⏱️ Complexity ⌚ T.C: O(n log n) (sorting) + O(n) window scan 🫙 S.C: O(1) (no extra space)
English
0
0
1
6
kartikcode's
kartikcode's@Kartscode·
⏱️ Time & Space Complexity ⏱️ T.C : O(n log n) → Sliding window + TreeSet insert/remove & rebalancing 🫙 S.C : O(n) → Two TreeSets to manage window elements
English
0
0
2
10
kartikcode's
kartikcode's@Kartscode·
⏱️ Time & Space Complexity ⌚T.C : O(26³ + n) → effectively O(n) (since 26 is constant) 🫙S.C : O(26²) → constant space
English
0
0
2
8
kartikcode's
kartikcode's@Kartscode·
⏱️ Time & Space Complexity ⌚ T.C: O(n log n) -> sorting dominates 🫙 S.C: O(1) -> extra space (excluding output list)
English
0
0
1
12
kartikcode's
kartikcode's@Kartscode·
⏱️ Time & Space Complexity ⌚ T.C : O(n log n) -> Sorting dominates the runtime 🫙 S.C: O(1) -> No extra space (in-place sorting)
English
0
0
1
11
kartikcode's
kartikcode's@Kartscode·
⏱️ Time & Space Complexity ✅ T.C : O(n) Each number is processed in constant time (bit shifts are bounded by 32 bits). ✅ S.C : O(1) (excluding output array)
English
0
0
5
21
kartikcode's
kartikcode's@Kartscode·
⏱️ Time & Space Complexity ⌚ Time Complexity: O(m × n × min(m, n)) 🫙 Space Complexity: O(1) (in-place prefix sum)
English
0
0
2
11
kartikcode's
kartikcode's@Kartscode·
@achieve71246717 Nicely done 👌 Classic recursion + backtracking pattern explained well. Pick → Recurse → Backtrack is the real DSA mindset 🔥
English
1
0
1
15
Anjali
Anjali@achieve71246717·
Built permutations using recursion in C++ Used a visited[] array to track choices and a temp vector to build paths step by step. Core idea: Pick an unused element Mark it visited Recurse Backtrack (undo choice) DSA gets real when backtracking clicks. #DSA #BuildInPublic
Anjali tweet media
English
4
0
45
404
kartikcode's
kartikcode's@Kartscode·
⏱️ Time & Space Complexity ⌚ T.C: O(n²) —> checking all rectangle pairs 🫙 S.C: O(1) — > no extra data structures
English
0
0
2
15
kartikcode's
kartikcode's@Kartscode·
⏱️Time & Space Complexity ⌚T.C : O(H² + V²) H = number of horizontal fences V = number of vertical fences We check all pairwise distances 🫙S.C : O(H²) For storing all horizontal distances in a HashSet
English
0
0
1
15