Leetcode solutions
Pages
(Move to ...)
▼
Thursday, February 27, 2025
LeetCode Solution 268 - Missing Number
›
Problem Statement Given an array nums containing n distinct numbers in the range [0, n] , return the only number in the range that is mis...
LeetCode Solution 338 - Counting Bits
›
Problem Statement Given an integer n , return an array ans of length n + 1 such that for each i (0 <= i <= n) , ans[i] is the numb...
LeetCode Solution 191 - Number of 1 Bits
›
Problem Statement Given an unsigned integer, return the number of 1 bits it has (also known as the Hamming weight ). Example 1: Input: ...
LeetCode Solution 371 - Sum of Two Integers
›
Problem Statement Given two integers a and b , return the sum of the two integers without using the + and - operators. Example 1: Inpu...
LeetCode Solution 42 - Trapping Rain Water
›
Problem Statement Given an array height of non-negative integers where each element represents the elevation at that index, compute how mu...
LeetCode Solution 125 - Valid Palindrome
›
Problem Statement Given a string s , determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Example...
LeetCode Solution 239 - Sliding Window Maximum
›
Problem Statement You are given an array nums and an integer k . You need to find the maximum value in every contiguous subarray of size k...
›
Home
View web version