# LeetCode 1046. Last Stone Weight

Description https://leetcode.com/problems/last-stone-weight/ We have a collection of stones, each stone has a positive integer weight. Each turn, we choose the two heaviest stones and…

# LeetCode 543. Diameter of Binary Tree

Description https://leetcode.com/problems/diameter-of-binary-tree/ Given a binary tree, you need to compute the length of the diameter of the tree. The diameter…

# LeetCode 190. Reverse Bits

Description https://leetcode.com/problems/reverse-bits/ Reverse bits of a given 32 bits unsigned integer. Example 1: Input: 00000010100101000001111010011100 Output: 00111001011110000010100101000000 Explanation: The input…

# LeetCode 191. Number of 1 Bits

Description https://leetcode.com/problems/number-of-1-bits/ Write a function that takes an unsigned integer and return the number of ‘1’ bits it has (also known as…

# LeetCode 461. Hamming Distance

Description https://leetcode.com/problems/hamming-distance/ The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two…

# LeetCode 326. Power of Three

Description https://leetcode.com/problems/power-of-three/ Given an integer, write a function to determine if it is a power of three. Example 1: Input:…

# LeetCode 204. Count Primes

Description https://leetcode.com/problems/count-primes/ Count the number of prime numbers less than a non-negative number, n. Example: Input: 10 Output: 4 Explanation: There…

# LeetCode 202. Happy Number

Description https://leetcode.com/problems/happy-number/ Write an algorithm to determine if a number is “happy”. A happy number is a number defined by…

# LeetCode 13. Roman to Integer

Description Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C…

# LeetCode 6. ZigZag Conversion

Description https://leetcode.com/problems/zigzag-conversion/description/ The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want…