Rain Catcher
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...
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...
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...
Given a list of positive integers nums, return whether there exist integers a, b, and c such that a ** 2 + b ** 2 = c ** 2.
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.
Given an integer n, return the nth (0-indexed) row of Pascal’s triangle.
Given a string s containing balanced parentheses "(" and ")", split them into the maximum number of balanced groups.
Given a binary tree root where each node contains a digit from 0-9, return whether its in-order traversal is a palindrome.
Given a non-negative integer num, return whether it is a palindrome.
Given a singly linked list node whose values are integers, determine whether the linked list forms a palindrome.
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.
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...
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).