📌 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...
Description Given an integer array nums, write an algorithm to move all 0’s to the end of the array while maintaining the relative order of the non-zero elements. You must do this in-place without making a copy of the array. My First Attempt [Time: O...
LeetCode Link Problem statement: You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. Merge nums1 and nums2 into a single arra...