Coding Exercise Posts - page 42 of 43

Recent posts

Base 3 to Integer

less than 1 minute read

Given a string s representing a number in base 3 (consisting only of 0, 1, or 2), return its decimal integer equivalent. This should be implemented directly ...

Balanced Brackets

less than 1 minute read

You’re given a string s consisting solely of "(" and ")". Return whether the parentheses are balanced.

Back to Front Linked List

less than 1 minute read

Given a singly linked list node, reorder it such that we take: the last node, and then the first node, and then the second last node, and then the second nod...

ASCII String to Integer

less than 1 minute read

You are given a string s containing digits from "0" to "9" and lowercase alphabet characters. Return the sum of the numbers found in s.

Arithmetic Sequences

less than 1 minute read

Given a list of integers nums, return the number of contiguous arithmetic sequences of length ≥ 3.

Arithmetic Sequence Permutation

1 minute read

Given a list of integers nums, return whether you can rearrange the order of nums such that the difference between every consecutive two numbers is the same.

Area Under Histogram

1 minute read

You are given a list of integers nums where each number represents the height in a histogram. Return the area of the largest rectangle that can be formed onl...

Append List to Sum Target

1 minute read

You are given a list of integers nums and integers k and target. Consider an operation where we choose an integer -k ≤ e ≤ k and append it to nums.

Ancient Astronaut Theory

less than 1 minute read

You are given a string dictionary, representing a partial lexicographic ordering of ancient astronauts’ dictionary. Given a string s, return whether it’s a l...

Almost Same Strings

less than 1 minute read

You are given a list of lowercase alphabet strings words where each string is of the same length. Return whether there’s two strings that differ only in one ...

Add One to List

less than 1 minute read

You are given a list of integers nums, representing a decimal number and nums[i] is between [0, 9].

Add Linked Lists

less than 1 minute read

Given a singly linked list l0 and another linked list l1, each representing a number with least significant digits first, return the summed linked list.