Close Menu
    Code and Debug
    • Home
    • Our Courses
    • Blog
    • About Us
    • Contact Us
    Facebook X (Twitter) Instagram YouTube WhatsApp
    • Home
    • Our Courses
    • Blog
    • About Us
    • Contact Us
    Facebook Instagram YouTube LinkedIn WhatsApp

    Code and Debug – BlogCode and Debug – Blog

    Code and Debug – BlogCode and Debug – Blog
    Data Structures & Algorithms

    Fruit Into Baskets | Leetcode 904 | Optimal Solution using Sliding Window

    5 Mins Read

    The problem “Fruit Into Baskets” asks for the length of the longest contiguous subarray that contains at most two distinct fruit types. Think…

    Data Structures & Algorithms

    Max Consecutive Ones III | Leetcode 1004 | Fixed Window Solution

    3 Mins Read

    The problem “Max Consecutive Ones III” asks for the length of the longest subarray containing only 1s after flipping at most k zeros to 1s. This is a classic sliding window problem where we maintain…

    Data Structures & Algorithms

    Longest Substring Without Repeating Characters | Leetcode 3 | Optimal Sliding Window Solution

    3 Mins Read

    The problem “Longest Substring Without Repeating Characters” asks for the length of the longest substring in a string s that contains no duplicate characters. A straightforward brute force approach…

    Data Structures & Algorithms

    Remove K Digits | Leetcode 402 | Optimal Stack Solution

    3 Mins Read

    Given string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removing k digits from num. Here’s the [Problem…

    Data Structures & Algorithms

    Asteroid Collision | Leetcode 735 | Optimal Stack Solution

    3 Mins Read

    We are given an array asteroids of integers representing asteroids in a row. The indices of the asteriod in the array represent…

    Data Structures & Algorithms

    Sum of Subarray Minimums | Leetcode 907 | Stack Optimal Solution

    4 Mins Read

    Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may…

    Data Structures & Algorithms

    0 – 1 Knapsack Problem | 5 DP Solutions in Python

    7 Mins Read

    Given n items, each with a specific weight and value, and a knapsack with a capacity of W, the task is to put the items in…

    Data Structures & Algorithms

    Partitions with Given Difference | Optimal Solution

    4 Mins Read

    Given an array arr[], partition it into two subsets(possibly empty) such that each element must belong to only one subset. Let…

    Data Structures & Algorithms

    Perfect Sum Problem | All 4 DP Solutions in Python

    6 Mins Read

    Given an array arr of non-negative integers and an integer target, the task is to count all subsets of the array whose sum…

    Data Structures & Algorithms

    Minimum sum partition | Solved using Tabulation in Python

    4 Mins Read

    Given an array arr[] containing non-negative integers, the task is to divide it into two sets set1 and set2 such that the absolute difference between their sums is…

    Previous 1 … 4 5 6 7 8 … 25 Next
    Categories
    • Data Structures & Algorithms (240)
      • Beginner (82)
      • Expert (52)
      • Intermediate (106)
    • Uncategorised (1)
    Recent Posts

    Symmetric Tree | Leetcode 101 | Recursive DFS Approach

    2 September 2025

    Binary Tree Right Side View | Leetcode 199 | BFS and DFS Approaches

    2 September 2025

    Bottom View of Binary Tree | BFS with Horizontal Distance Mapping

    2 September 2025

    Top View of Binary Tree | BFS with Horizontal Distance Mapping

    2 September 2025

    Vertical Order Traversal of a Binary Tree | Leetcode 987 | BFS + Sorting Solution

    2 September 2025
    Facebook Instagram YouTube LinkedIn WhatsApp
    © 2025 Code and Debug. All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.