Coding Exercise Posts - page 29 of 43

Recent posts

One Integer

1 minute read

You are given a list of integers nums. You can reduce the length of nums by taking any two integers, removing them, and appending their sum to the end. The c...

Odd Number of Digits

less than 1 minute read

Given a list of positive integers nums, return the number of integers that have odd number of digits.

Number of Unique Character Substrings

less than 1 minute read

Given a lowercase alphabet string s, return the total number of substrings that contain one unique character.

Number of Sublists With Sum of Target

less than 1 minute read

Given a list of integers nums and an integer target, return the number of sublists whose sum is equal to target.

Number of Bits

less than 1 minute read

Given an integer n, return the number of 1 bits in n.

Nth Fibonacci Number

1 minute read

The Fibonacci sequence goes like this: 1, 1, 2, 3, 5, 8, 13, 21, 34, …

Noisy Palindrome

less than 1 minute read

You are given a string s containing lowercase and uppercase alphabet characters as well as digits from "0" to "9". Return whether s is a palindrome if we onl...

Next Node on Its Right

1 minute read

You are given a binary tree root containing unique values, and an integer target. Find the node with value target and return the node that’s directly right o...

Narcissistic Number

less than 1 minute read

Given an integer n, return whether it is equal to the sum of its own digits raised to the power of the number of digits.

N-Rooks

1 minute read

You’ve got an integer n representing a chessboard of size n x n. Return the number of ways you can place n rooks, such that no two rooks attack each other.

Mutual Followers

less than 1 minute read

You are given a two-dimensional list of integers relations. Each element relations[i] contains [a, b] meaning that person a is following person b on Twitter.

Most Frequent Number in Intervals

less than 1 minute read

You are given a list of list of integers intervals where each element contains the inclusive interval [start, end].