K Prefix
Given a list of integers nums and an integer k, return the maximum possible i where nums[0] + nums[1] + ... + nums[i] ≤ k. Return -1 if no valid i exists.
Given a list of integers nums and an integer k, return the maximum possible i where nums[0] + nums[1] + ... + nums[i] ≤ k. Return -1 if no valid i exists.
You are given a list of non-negative integers nums. If there are exactly k numbers in nums that are greater than or equal to k, return k. Otherwise, return -1.
Given a list of strings shows, a list of integers durations, and an integer k, where shows[i] and durations[i] represent the name and duration watched by the...
Given a list of integers nums, return the largest integer k where k and -k both exist in nums (they can be the same integer). If there’s no such integer, ret...
Given a list of integers nums and an integer k, return true if you can remove exactly one element from the list to make the average equal to exactly k.
Given a binary tree root, invert it so that its left subtree and right subtree are swapped and the children are recursively inverted.
The factorial of a number n is defined as n! = n * (n - 1) * (n - 2) * ... * 1.
You are given a two-dimensional list of integers intervals and an integer point. Each element contains [start, end] represents an inclusive interval.
You are given a list of closed intervals l0 and another list of intervals l1. Individually, each list is non-overlapping and are sorted in ascending order.
Given a two-dimensional integer list intervals of the form [start, end] representing intervals (inclusive), return their intersection, that is, the interval ...
Given two strings s0 and s1, return the two strings interleaved, starting with s0. If there are leftover characters in a string they should be added to the e...
Given an integer n, return its corresponding Roman numeral.