Repeated Deletion
Given a string s, repeatedly delete the earliest consecutive duplicate characters.
Given a string s, repeatedly delete the earliest consecutive duplicate characters.
Given a positive integer n, sum all of its digits to get a new number. Repeat this operation until the new number is less than 10 and return it.
Given a string s containing "0"s and "1"s, consider an operation where you pick a character and toggle its value from "0" to "1" or from "1" to "0". Return t...
Given two strings s0 and s1, return whether you can obtain s1 by removing 1 letter from s0.
Given a list of integers nums, find all duplicate numbers and delete their last occurrences.
Given a list of integers nums, consider an operation where you pick any number e and remove every number in nums equal to e. Return the minimum number of ope...
Given a singly linked list node, remove nodes with duplicate values while maintaining relative order of the original list.
Given an integer n, return the nth (0-indexed) gray code number. Gray code is a way of ordering binary numbers such that each consecutive number’s values dif...
Given a lowercase alphabet string s, return the index of the first recurring character in it. If there are no recurring characters, return -1.
You are given two lists of integers rect0 and rect1 representing coordinates (x0, y0, x1, y1) of two rectangles. (x0, y0) is the bottom left coordinate and (...
You are given a list of integers nums and a two-dimensional list of integers operations. Each operation is of the following form: [L, R, X], which means that...
Implement a data structure with the following methods: