Abhinav Chauhan·Aug 31, 2025Container With Most WaterYou are given an array arr of positive integers where each element represents the height of a vertical line on a coordinate plane.
Abhinav Chauhan·Aug 30, 2025Finding the Celebrity in a PartyImagine you are at a party where everyone either knows or doesn’t know each other. Among them, there might be a celebrity — a person who…
Abhinav Chauhan·Aug 29, 2025Smallest Window SubstringWe are given two strings s and p. The task is to find the smallest substring in s which contains all characters of p (including…
Abhinav Chauhan·Aug 28, 2025Maximum Consecutive 1s with At Most K FlipsWe are given a binary array arr[] containing only 0s and 1s, and an integer k. We are allowed to flip at most k zeros to ones. The task is…
Abhinav Chauhan·Aug 27, 2025Finding the Number of Possible Triangles from an ArrayWhen given an integer array arr[], we want to find the number of triangles that can be formed using three different elements of the array…
Abhinav Chauhan·Aug 19, 2025Finding the Farthest Smaller Element in an ArrayYou are given an array arr[] of size n. For each element arr[i], the task is to find the farthest index j such that:
Abhinav Chauhan·Aug 18, 2025Understanding and Solving the H-Index Problem in O(n)The H-index is a common metric used in academia to measure both productivity and citation impact of a researcher’s work.