Airplane Seat Shuffling
You are given an integer n representing the number of seats in an airplane. The first person has lost their ticket, so they pick a random seat. Everyone else...
You are given an integer n representing the number of seats in an airplane. The first person has lost their ticket, so they pick a random seat. Everyone else...
You are given three positive integers a, b and target. Consider an operation where you take either a or b and update one of the bits to 1 or to 0.
Given a singly linked list of integers node, sort the nodes by their values in ascending order.
You are given a list of integers nums and a two-dimensional list of integers queries. Each element in queries contains [i, j] and asks what is the value of n...
Given a list of integers nums and an integer k, return a list of count of distinct numbers in each window of size k.
Given a binary tree root, return the maximum sum of a subtree. A subtree is defined to be some node in root including all of its descendants. A subtree sum i...
Given a list of distinct integers pushes, and another list of integers pops, return whether this is a valid sequence of stack push and pop actions.
You are given a list of integers nums and an integer k. You must subtract 1 from any element in the list k times. Return the minimum possible maximum value i...
You are given a two-dimensional list of integers edges representing a connected, directed, acyclic graph. Each element in edges contains [u, v] meaning there...
A sequence is called bitonic if it’s strictly increasing and then strictly decreasing. A sequence that is only strictly increasing is bitonic. Also, a sequen...
Given two sorted linked lists l0, and l1, return a new sorted linked list containing the intersection of the two lists.
You are given a lowercase alphabet string s. Return the number of ways to split the string into two strings such that the number of distinct characters in ea...