Coding Exercise Posts - page 40 of 43

Recent posts

Consecutively Descending Integers

less than 1 minute read

Given a string s containing digits, return whether it contains consecutively descending integers.

Consecutive Ones

less than 1 minute read

You are given a list of integers nums which contains at least one 1. Return whether all the 1s appear consecutively.

Consecutive Duplicates

less than 1 minute read

Given a string s, consisting of "X" and "Y"s, delete the minimum number of characters such that there’s no consecutive "X" and no consecutive "Y".

Compress String

less than 1 minute read

Given a string lowercase alphabet s, eliminate consecutive duplicate characters from the string and return it.

Complete Binary Tree

less than 1 minute read

Given a binary tree root, return whether it’s a complete binary tree.

Complete an Arithmetic Sequence

less than 1 minute read

You are given a list of integers nums that used to be an arithmetic sequence. Given that a number was removed, and that the number was not the first or the l...

Common Words

less than 1 minute read

Given two strings s0 and s1, each representing a sentence, return the number of unique words that are shared between the two sentences.

Column Sort

less than 1 minute read

Given a two-dimensional integer matrix, sort each of the columns in ascending order.

Collecting Coins

1 minute read

You are given a two-dimensional integer matrix where each cell represents number of coins in that cell. Assuming we start at matrix[0][0], and can only move ...

Collatz Sequence

less than 1 minute read

Given a positive integer n, find the length of its Collatz sequence. The Collatz sequence is generated sequentially where

Closest Distance to Character

less than 1 minute read

Given a string s and a character c, return a new list of integers of the same length as s where for each index i its value is set the closest distance of s[i...

Clock Angle

less than 1 minute read

Given a clock time with hour and integer minutes, determine the smaller angle between the hour and the minute hands and floor it to the nearest integer.