---
title: "Shahwar Alam Naqvi (@shahwar01) | Hashnode"
description: "Coder. Read the latest articles by Shahwar Alam Naqvi on Hashnode."
url: "https://hashnode.com/@shahwar01"
---

@shahwar01

# Shahwar Alam Naqvi

@shahwar01 · Joined October 2025

Coder

### [LeetCode: Contains Duplicate II](https://is-power-of-two.hashnode.dev/leetcode-contains-duplicate-ii?utm_source=hashnode&utm_medium=feed)

Problem: https://leetcode.com/problems/contains-duplicate-ii/ Code: class Solution: def containsNearbyDuplicate(self, nums: List\[int\], k: int) -> bool: # window = k seen\_in\_window = set() for i in range(len(nums)): ...

2 min read · [is-power-of-two.hashnode.dev](https://is-power-of-two.hashnode.dev/leetcode-contains-duplicate-ii?utm_source=hashnode&utm_medium=feed)

[Jan 9](https://hashnode.com/posts/leetcode-contains-duplicate-ii/69614072f1a87e8d3e6dddb1)

### [LeetCode: Rearrange Array Elements by Sign](https://is-power-of-two.hashnode.dev/leetcode-rearrange-array-elements-by-sign?utm_source=hashnode&utm_medium=feed)

Problem: https://leetcode.com/problems/rearrange-array-elements-by-sign/ Code: class Solution: def rearrangeArray(self, nums: List\[int\]) -> List\[int\]: non\_neg\_nums = \[\] neg\_nums = \[\] result = \[\] # Segregated non-n...

2 min read · [is-power-of-two.hashnode.dev](https://is-power-of-two.hashnode.dev/leetcode-rearrange-array-elements-by-sign?utm_source=hashnode&utm_medium=feed)

[Dec 26, 2025](https://hashnode.com/posts/leetcode-rearrange-array-elements-by-sign/694e2dbfab4751437a42a3a1)

### [GeeksForGeeks: Array Leaders](https://is-power-of-two.hashnode.dev/geeksforgeeks-array-leaders?utm_source=hashnode&utm_medium=feed)

Problem: https://www.geeksforgeeks.org/problems/leaders-in-an-array-1587115620/1 Code: class Solution: def leaders(self, arr): leads = \[\] n = len(arr) maximum = arr\[-1\] # till will handle negatives # we will colle...

2 min read · [is-power-of-two.hashnode.dev](https://is-power-of-two.hashnode.dev/geeksforgeeks-array-leaders?utm_source=hashnode&utm_medium=feed)

[Dec 26, 2025](https://hashnode.com/posts/geeksforgeeks-array-leaders/694e1c08eb464057eb5b90e7)

### [LeetCode: Intersection of Two Arrays](https://is-power-of-two.hashnode.dev/leetcode-intersection-of-two-arrays?utm_source=hashnode&utm_medium=feed)

Problem: https://leetcode.com/problems/intersection-of-two-arrays/ Code: class Solution: def intersection(self, nums1: List\[int\], nums2: List\[int\]) -> List\[int\]: result = set() n2 = set(nums2) for num in nums1: ...

2 min read · [is-power-of-two.hashnode.dev](https://is-power-of-two.hashnode.dev/leetcode-intersection-of-two-arrays?utm_source=hashnode&utm_medium=feed)

[Dec 24, 2025](https://hashnode.com/posts/leetcode-intersection-of-two-arrays/694b4e4ecc5dbe9267f30efb)

### [LeetCode: Repeated Substring Pattern](https://is-power-of-two.hashnode.dev/leetcode-repeated-substring-pattern?utm_source=hashnode&utm_medium=feed)

Problem: https://leetcode.com/problems/repeated-substring-pattern/ Code: class Solution: def repeatedSubstringPattern(self, s: str) -> bool: return s in (s + s)\[1:-1\] # Points to note: # - A repeated string will reappear ...

4 min read · [is-power-of-two.hashnode.dev](https://is-power-of-two.hashnode.dev/leetcode-repeated-substring-pattern?utm_source=hashnode&utm_medium=feed)

[Dec 22, 2025](https://hashnode.com/posts/leetcode-repeated-substring-pattern/6948df5daea2b63dab323450)
