Coding Exercise Posts - page 38 of 43

Recent posts

FizzBuzz

less than 1 minute read

Given an integer n, return a list of integers from 1 to n as strings except for multiples of 3 use “Fizz” instead of the integer and for the multiples of 5 u...

Fixed Point

less than 1 minute read

Given a list of unique integers nums sorted in ascending order, return the minimum i such that nums[i] == i. If there’s no solution, return -1.

First to Count to Target

1 minute read

You are playing a game against a friend where in each round you pick a number from 1 to k to add to a shared running total that initially starts from 0. The ...

First Missing Positive

1 minute read

Given a list of integers nums, find the first missing positive integer. In other words, find the lowest positive integer that does not exist in the list. The...

First Fit Room

1 minute read

You are given a list of integers rooms and an integer target. Return the first integer in rooms that’s target or larger. If there is no solution, return -1.

Find Local Peaks

1 minute read

You are given a list of integers nums. Return the index of every peak in the list, sorted in ascending order. An index i is called a peak if:

File System

1 minute read

Implement a data structure with the following methods:

Factorial Sum

less than 1 minute read

Given a positive integer n, return whether n can be written as the sum of distinct positive factorial numbers.

Even Frequency

less than 1 minute read

Given a list of integers nums, return whether all numbers appear an even number of times.

Equivalent Value and Frequency

less than 1 minute read

Given a list of integers nums, return whether there’s an integer whose frequency in the list is same as its value.

Equivalent Pairs

less than 1 minute read

You are given a list of integers nums. Return the number of pairs i < j such that nums[i] = nums[j].

Equalize List Sums with Minimal Updates

1 minute read

You are given two lists of integers a and b where every element in both lists is between 1 to 6. Consider an operation where you pick a number in either a or...