Coding Exercise Posts - page 37 of 43

Recent posts

High Frequency

less than 1 minute read

Given a list of integers nums, find the most frequently occurring element and return the number of occurrences of that element.

Height Balanced Tree

less than 1 minute read

Given the root of a binary tree, return whether its height is balanced. That is, for every node in the tree, the absolute difference of the height of its lef...

Hash Table

1 minute read

Implement a hash table with the following methods:

Happy Numbers

2 minute read

Given an integer n, we apply this transformation until it becomes a 1: take each of the digits in n, square it, and then take their sum.

Hamming Distance

less than 1 minute read

Given two integers x, and y return the number of positions where their values differ in their binary representations as a 32-bit integer.

Guess the Root

less than 1 minute read

Given a non-negative integer n, find a number r such that r * r = n and round down to the nearest integer.

Group Integers

1 minute read

Given a list of integers nums, return whether you can split the list into 1 or more groups where:

Greatest Common Divisor

less than 1 minute read

Given a list of positive integers nums, return the largest positive integer that divides each of the integers.

Generate Primes

less than 1 minute read

Given a number n, return a list of all prime numbers smaller than or equal to n in ascending order.

Furthest From Origin

1 minute read

You are given a string s where each character is "L" meaning you moved one unit left, "R" meaning you moved one unit right, or "?" meaning either "L" or "R".

Flip to Zeros

less than 1 minute read

You are given an integer list nums containing 0s and 1s. Consider an operation where we pick an index i in nums and flip i as well as all numbers to the righ...

Flip and Invert Matrix

less than 1 minute read

You are given a two-dimensional integer matrix matrix containing 1s and 0s. For each row in matrix, reverse the row. Then, flip each value in the matrix such...