All Posts

Leetcode 169: Majority Element

Given an array nums of size n, return the majority element. The majority element is the element that appears more than n // 2 times. You may assume that the majority element always exists in the array.

Leetcode 215: Kth Largest Element in an Array

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

Leetcode 217: Contains Duplicate

Given an array of integers, determine if there are any duplicate values present. Return true if any value appears more than once, otherwise return false.

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 242: Valid Anagram

You are given two strings, s and t. Determine if t is an anagram of s. Two strings are considered anagrams if they contain the exact same characters, but possibly in a different order.

Leetcode 268: Missing Number

Given an array nums containing n distinct numbers, each in the range [0, n], return the only number in the range that is missing from the array.