443. String Compression Algorithm Overview The solution implements an in-place string compression algorithm using a two-pointer approach. Here's how it works: read: scans through the original characters write: tracks where to place the compressed o...
Sliding Window is one of the most efficient and elegant techniques used in solving problems involving arrays or strings. Especially useful when you're dealing with subarrays or substrings, it allows you to reduce time complexity by avoiding unnecessa...
📌 1. What is Two Pointers? The Two Pointers technique uses two variables (usually indices) to traverse a list or string from different directions (e.g., start and end).By controlling the movement of these pointers, you can solve problems more effici...
Today I officially started my grind toward 1400+ on CodeChef. I’ve kept the first day light but insightful — focused mostly on two-pointer logic, frequency maps, and a neat parity-based math problem. Here’s what I worked on: 🔹 Problem 1: LeetCode 9...
📅 Date: June 25, 2025 🧹 Problem: Given two sorted arrays, find the k-th smallest product that can be formed by multiplying one element from each array. 🔗 LeetCode link 🏷️ Tags: Binary Search, Two Pointers, Math 🚀 Problem Summary You're given t...
Hey folks! Today I encounted a problem which I tried solving 2 years back (2023) Question Link → 1498. Number of Subsequences That Satisfy the Given Sum Condition So, looking at my 2 year old attempt, I wanted to challenge myself to solve it this ti...
🔍 Problem Statement Given a 1-indexed array of integers numbers that is sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index...
Problem description A naive method find all the numbers that has a value of key, save their positions in a list loop through the list as j find index i that is not k steps further than j if there is at least 1 index i that fits the requiremnt, add...
Welcome to this week's #TutorialsTuesday series! Last week, we kicked off our journey into Data Structures and Algorithms (DSA) problem-solving and introduced the concept of DSA patterns. As promised, every Tuesday, we're diving deep into one specifi...
Problem Description I assume you have read the original problem description in the link above, so I will share some key points about a common mistake in the problem, which is using a greedy approach. A common mistake: greedily delete from the most co...