All Posts

Leetcode 210: Course Schedule II

You are given a set of courses with prerequisites, and you need to find a valid order to take them, or return an empty array if no valid order exists.

Leetcode 211: Design Add and Search Words Data Structure

You are tasked with creating a data structure that allows adding words and checking if a word matches any previously added word, with support for the wildcard ‘.’ character.

Leetcode 213: House Robber II

You are tasked with designing a strategy to rob houses along a circular street, where no two adjacent houses can be robbed on the same night. The goal is to maximize the total money stolen without triggering security alarms.

Leetcode 215: Kth Largest Element in an Array

Given an array of integers, find the kth largest element without sorting the entire array.

Leetcode 229: Majority Element II

Given an integer array, find all elements that appear more than ⌊n/3⌋ times, where n is the length of the array. Your task is to return a list of all such elements.

Leetcode 230: Kth Smallest Element in a BST

Given the root of a binary search tree and an integer k, your task is to return the kth smallest value in the tree (1-indexed).