Skip to content

Instantly share code, notes, and snippets.

View Sadiq-Teslim's full-sized avatar

Teslim Adetola Sadiq Sadiq-Teslim

View GitHub Profile
@Sadiq-Teslim
Sadiq-Teslim / main.md
Created February 3, 2026 21:49
Base 7

Base 7

Question

Approach

I used the standard Iterative Modulo and Division method for base conversion. This is the same mathematical process used to convert numbers to binary, octal, or hexadecimal manually.

Strategy:

@Sadiq-Teslim
Sadiq-Teslim / main.md
Created February 1, 2026 22:58
Remove Invalid Parentheses

Remove Invalid Parentheses

Question

Approach

I used a Breadth-First Search (BFS) approach. Since the problem asks for the minimum number of removals, BFS is ideal because it guarantees that the first time we find a valid string, it is at the shortest "distance" (fewest removals) from the original string.

Strategy:

@Sadiq-Teslim
Sadiq-Teslim / main.md
Created January 31, 2026 22:57
Count Items Matching a Rule

Count Items Matching a Rule

Question

Approach

I used a Linear Scan approach. Since the structure of each item is fixed (always [type, color, name]), we can map the ruleKey to a specific index and check every item against the ruleValue.

Strategy:

@Sadiq-Teslim
Sadiq-Teslim / main.md
Created January 30, 2026 22:53
Add String

Add Strings

Question

Approach

I used a Two Pointer simulation approach. This method mimics the manual "column addition" we learn in elementary school, processing digits from right to left and managing the carry.

Strategy:

@Sadiq-Teslim
Sadiq-Teslim / main.md
Created January 29, 2026 22:50
Keyboard Row

Keyboard Row

Question

Approach

I used a Set Lookup approach. By converting each row of the keyboard into a set of characters, we can efficiently check if every letter of a word belongs to the same set.

Strategy:

@Sadiq-Teslim
Sadiq-Teslim / main.md
Created January 28, 2026 22:29
Is Subsequence

Is Subsequence

Question

Approach

I used a Two Pointer (Greedy) approach. We traverse the target string t once, looking for characters from s in order.

Strategy:

@Sadiq-Teslim
Sadiq-Teslim / main.md
Created January 27, 2026 21:02
Add Binary

Add Binary

Question

Approach

I used a bit-by-bit simulation approach, similar to how we perform column addition manually. By iterating from the end of both strings to the beginning, we can compute the sum and carry for each position.

Strategy:

@Sadiq-Teslim
Sadiq-Teslim / main.md
Created January 26, 2026 22:24
Add Binary

Add Binary

Question

Approach

I used a bit-by-bit simulation approach, similar to how we perform column addition manually. By iterating from the end of both strings to the beginning, we can compute the sum and carry for each position.

Strategy:

@Sadiq-Teslim
Sadiq-Teslim / main.md
Created January 25, 2026 21:25
Next Greater Element I

Next Greater Element I

Question

Approach

I used a Monotonic Stack combined with a Hash Map. This allows us to find the next greater element for every number in nums2 in a single pass ($O(n)$), rather than using nested loops ($O(n^2)$).

Strategy:

@Sadiq-Teslim
Sadiq-Teslim / main.md
Created January 24, 2026 21:30
Find the Difference

Find the Difference

Question

Approach

I used a Hash Map (Frequency Counter) approach. Since string t is generated by shuffling string s and adding one more letter, the character counts will be identical except for exactly one character.

Strategy: