Suchergebnisse: "#ArrayProblems"
8 Ergebnisse
⚡ Daily Coding Problem!
Find duplicates in an array - BUT with O(1) extra space!
Input: [1,2,3,2,4,3,5]
Output: [2,3]
Can you solve it without HashMap? 🧠
Share your approach in comments!
#Algorithms #ArrayProblems #OptimizedCode #JavaCoding
English

LeetCode 2149 – Rearrange Array Elements by Sign
Solved: Rearrange array with alternating+ve and-ve elements
Used two lists to collect positives & negatives
Then merged alternately→O(n) time,O(n) space
Great for understanding order-based array handling!
#LeetCode #ArrayProblems
English

LeetCode 414 – Third Maximum Number
Solved: Find the 3rd distinct max number in the array
Used a set to track unique values
Handled edge case: return max if < 3 distinct numbers
Cleans up logic around max tracking & uniqueness!
#LeetCode #PythonDSA #ArrayProblems
English

LeetCode 905 – Sort Array By Parity
Solved: Sort array so even numbers come before odds
Used two-pointer approach to build new array
Also tried in-place method using swaps
Great for strengthening conditional + pointer logic!
#LeetCode #PythonDSA #ArrayProblems
English

LeetCode 941 – Valid Mountain Array
Solved: Check if the array forms a valid mountain shape
Strictly increasing, then strictly decreasing
Used two-pointer climb + descent logic
Edge cases = key here
Great mix of condition checks & pointer flow!
#LeetCode #PythonDSA #ArrayProblems
English

LeetCode 1089 – Duplicate Zeros
Solved: Duplicate each zero in the array in-place, shifting elements right
Used two passes:
Count how many zeros can be duplicated
Fill from the back using reverse two-pointer
Great for tricky in-place logic!
#LeetCode #PythonDSA #ArrayProblems
English


