Coding Exercise Posts - page 28 of 43

Recent posts

Rain Catcher

1 minute read

You are given a list of non-negative integers nums where each element represents the height of a hill. Suppose it will rain and all the spaces between two si...

Quadratic Application

1 minute read

You are given a list of integers nums sorted in ascending order, and integers a, b, and c. Apply the following function for each number x in nums: \(ax^2 + b...

Pythagorean Triplets

less than 1 minute read

Given a list of positive integers nums, return whether there exist integers a, b, and c such that a ** 2 + b ** 2 = c ** 2.

Prime Factorization

less than 1 minute read

You can write out a number as a product of prime numbers, which are its prime factors. The same prime factor may occur more than once.

Pascal’s Triangle

less than 1 minute read

Given an integer n, return the nth (0-indexed) row of Pascal’s triangle.

Parentheses Grouping

less than 1 minute read

Given a string s containing balanced parentheses "(" and ")", split them into the maximum number of balanced groups.

Palindromic Tree

less than 1 minute read

Given a binary tree root where each node contains a digit from 0-9, return whether its in-order traversal is a palindrome.

Palindromic Integer

less than 1 minute read

Given a non-negative integer num, return whether it is a palindrome.

Palindrome Linked List

less than 1 minute read

Given a singly linked list node whose values are integers, determine whether the linked list forms a palindrome.

Pair Sums to Power of Two

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] is equal to 2 ** k for some 0 ≤ k.

Pair and Triples

1 minute read

You are given a string s containing digits from 0 to 9. Return whether there is some arrangement where we can have one pair of the same digits and the rest o...

Only Child

less than 1 minute read

Given a binary tree root, return the number of nodes that are an only child. A node x is an only child if its parent has exactly one child (x).