LeetCode Blind 12/75: Counting Bits

Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1’s in the binary representation of i.

June 24, 2022

LeetCode Blind 11/75: Number of 1 Bits

Write a function that takes an unsigned integer and returns the number of ‘1’ bits it has (also known as the Hamming weight).

June 24, 2022

LeetCode Blind 10/75: Container with most water

Find two lines that together with the x-axis form a container, such that the container contains the most water.

June 23, 2022

LeetCode Blind 9/75: 3Sum

Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.

June 22, 2022

LeetCode Blind 8/75: Search in Rotated Sorted Array

Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.

June 21, 2022

LeetCode Blind 7/75: Find Minimum in Rotated Sorted Array

Given the sorted rotated array nums of unique elements, return the minimum element of this array.

June 20, 2022

LeetCode Blind 6/75: Maximum Product Subarray

Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest product and return its product.

June 20, 2022

LeetCode Blind 5/75: Maximum Subarray

Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.

June 18, 2022

LeetCode Blind 4/75: Product of Array Except Self

Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].

June 17, 2022

LeetCode Blind 3/75: Contains Duplicates

Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.

June 17, 2022