All Posts

Leetcode 703: Kth Largest Element in a Stream

You are tasked with implementing a class that helps track the kth highest score in a dynamic list of test scores. Each time a new score is submitted, you need to return the kth highest score in the list.

Leetcode 704: Binary Search

You are given a sorted array of integers and a target value. Your task is to search for the target in the array. If the target exists, return its index. If it does not exist, return -1. You must achieve a time complexity of O(log n).

Leetcode 705: Design HashSet

Design a custom HashSet without using any built-in hash table libraries. Implement the MyHashSet class with methods to add, remove, and check the existence of a value.

Leetcode 724: Find Pivot Index

Given an array of integers, find the pivot index where the sum of elements to the left equals the sum of elements to the right.

Leetcode 733: Flood Fill

You are given an m x n grid representing an image, where each element in the grid corresponds to a pixel value. Additionally, you’re provided with three integers: sr (starting row), sc (starting column), and color. Your task is to perform a flood fill operation on the image starting at the pixel located at (sr, sc).

Leetcode 744: Find Smallest Letter Greater Than Target

You are given a sorted array letters containing lowercase English letters and a character target. Return the smallest character in letters that is lexicographically greater than target. If no such character exists, return the first character in letters.