Wildcard Matching LeetCode Solution

Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for ‘?’ and ‘*’ where: ‘?’ Matches any single character.’*’ Matches any sequence of characters (including the empty sequence).The matching should cover the entire input string.

Wildcard Matching LeetCode Solution Read More »

Leetcode Solution

Jump Game II LeetCode Solution

You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0]. Each element nums[i] represents the maximum length of a forward jump from index i. In other words, if you are at nums[i], you can jump to any nums[i + j] where: 0 <= j <= nums[i] and i + j < n. Return the minimum number of jumps to reach nums[n - 1].

Jump Game II LeetCode Solution Read More »

Leetcode Solution

What is Depth First Search and how they works?

This article explores Depth First Search, its recursive and iterative implementations, and its time complexity, and provides code examples in Python and JavaScript. 1. What is Depth First Search? Depth First Search (DPS) is a graph traversal algorithm that explores as far as possible along each branch before backtracking. It uses a stack-based approach, either

What is Depth First Search and how they works? Read More »

Algorithm

What is Breadth First Search & how they works?

This article explores the Breadth First Search, its implementation in different programming languages, and its runtime complexities. 1. Graph Traversals Graph traversal means visiting every vertex and edge exactly once in a well-defined order. During a traversal, you must track which vertices have been visited. The most common way of tracking vertices is to mark

What is Breadth First Search & how they works? Read More »

Algorithm

What are Dynamic Programming Problems?

This article explores Dynamic Programming Problems, the top-down and bottom-up approaches, their differences with recursion, and some classic examples like Fibonacci and Longest Increasing Subsequence. 1. What are Dynamic Programming Problems? Dynamic Programming is a powerful technique to solve a complicated problem by breaking it down into simpler subproblems. It can be solved by breaking

What are Dynamic Programming Problems? Read More »

Algorithm

How Greedy Algorithm Works?

This article explores greedy algorithms, how greedy algorithm works, their applications, and how they compare to other algorithms like dynamic programming. 1. What is a Greedy Algorithm? A Greedy Algorithm is a simple, intuitive algorithm used in optimization problems. It is designed to achieve the optimum solution for a given problem. This algorithm builds up

How Greedy Algorithm Works? Read More »

Algorithm

What are Divide and Conquer Algorithm Problems?

This article explores the Divide and Conquer Algorithm Problems, their applications, advantages, and some of the most common problems solved using this technique. 1. What are Divide and Conquer Algorithm Problems? Divide and Conquer is an important algorithm design technique based on recursion. Some problems failed to provide optimal solutions. Among those problems, some are

What are Divide and Conquer Algorithm Problems? Read More »

Algorithm

What is Shell Sort Algorithm and how does it works?

This article explores the Shell Sort Algorithm, how it works, its pseudocode, implementations in C++ and Python, time complexity, advantages, and disadvantages. 1. What is the Shell Sort Algorithm? The Shell Sort Algorithm is also called diminishing increment sort. It is a highly efficient sorting technique and serves as an enhancement of insertion sort. It

What is Shell Sort Algorithm and how does it works? Read More »

Algorithm
Scroll to Top