Algorithms

1.4) Is Subsequence or not?

Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string generated from the…

1.3) Counting Bits

Given a non-negative integer n, for every i (0 ≤ i ≤ n), calculate the number of 1's in their binary representation and return an array.

1.2) Fibonacci Number

The Fibonacci numbers are a sequence of numbers where each number is the sum of the two preceding ones, starting from 0 and 1. Given an integer n, find the…

1.2) Subsets

Given a set of distinct integers nums, return all possible subsets (the power set) of the set.

1.1) Dynamic Programming Explained

Dynamic Programming is a problem-solving technique used to solve complex problems by breaking them down into smaller overlapping subproblems and solving each subproblem only once, storing its solution for future…

1.1) Greedy Algorithms

Greedy algorithms are problem-solving techniques that make locally optimal choices at each step with the hope of finding a global optimum (best overall solution). At each decision point, a greedy…

1.1) What is Backtracking?

Backtracking is a problem-solving technique that involves exploring all possible solutions to find the correct one. It is often used when dealing with problems that have multiple potential solutions, and…

1.1) What is Recursion?

Recursion is a programming concept where a function calls itself to solve a problem in smaller subproblems. In simple terms, it's like solving a big problem by breaking it down…

Sorting Algorithms: Introduction

They are algorithms designed to arrange a list of items in a specific order, such as ascending or descending numerical order or lexicographic order for strings. Sorting is a fundamental…

Searching Algorithms

Searching algorithms are algorithms designed to find the location or existence of a specific item (also known as a target or key) within a collection of data, such as an…