Coding Patterns

Find Right Interval

Given a list of intervals intervals, where intervals = , for each interval i, find the index of the interval j such that start_j is the smallest possible value that…

IPO Problem

You are given k projects, each with a capital value and a profit value. You are also given an initial capital. The i-th project requires capital capital to start, and…

Sliding Window Median

Given an array of integers nums and an integer k, you need to find the median of each window of size k moving from left to right in the array.…

Concatenated Words

Given a list of words, you need to find all the concatenated words in the list. A concatenated word is defined as a word that can be formed by concatenating…

Implement Trie (Prefix Tree)

A Trie (Prefix Tree) is a tree-like data structure used to efficiently store a dynamic set of strings while allowing efficient prefix search. In this problem, you need to implement…

Word Break

Given a string s and a dictionary of words dict, you need to determine if s can be segmented into a space-separated sequence of one or more dictionary words.

Minimum Height Trees

You are given a tree represented as an undirected graph, where each node has a unique value between 0 and n-1. The tree is given as a list of edges.…

Alien Dictionary

Given a list of words sorted in a special alien language, find the order of characters in that language. The alien language is represented by a list of words where…