Integer to Base 3
Given an integer n, return its base 3 representation as a string.
Given an integer n, return its base 3 representation as a string.
Given a list of integers nums, sorted in ascending order, and a number target, return the index where target should be inserted to keep nums sorted. If targe...
You are given a singly linked list head as well as integers pos and val. Insert a new node with value val before index pos of head.
Given a binary tree root, return an inorder traversal of root as a list.
Given a binary search tree root containing unique values, and an integer t, return the value of the inorder successor of t. That is, return the smallest valu...
Given a list of integer nums, return the earliest index i such that the sum of the numbers left of i is equal to the sum of numbers right of i. If there’s no...
You are given an alphabet (can be lower or uppercase) string s and two integers i and j where i < j. Let’s say p is an infinite string of s repeating fore...
Given an integer n, return the number of positive integers of length n such that the digits are strictly increasing.
Given a list of integers nums, put all the zeros to the back of the list by modifying the list in-place. The relative ordering of other elements should stay ...
Given an integer list nums where each number represents the maximum number of hops you can make, determine whether you can reach to the last index starting a...
Implement a hit counter which keeps track of number of the number of hits in the last 60 seconds.
Implement a data structure StockMarket which has the following methods: