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.
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.
Write a function that takes an unsigned integer and returns the number of ‘1’ bits it has (also known as the Hamming weight).
Find two lines that together with the x-axis form a container, such that the container contains the most water.
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.
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.
Given the sorted rotated array nums of unique elements, return the minimum element of this array.
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest product and return its product.
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
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].
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.