Coding Exercise Posts - page 36 of 43

Recent posts

Integer to Base 3

less than 1 minute read

Given an integer n, return its base 3 representation as a string.

Insertion Index in Sorted List

1 minute read

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...

Insert Into Linked List

less than 1 minute read

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.

Inorder Traversal

less than 1 minute read

Given a binary tree root, return an inorder traversal of root as a list.

Inorder Successor

1 minute read

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...

Index with Equal Left and Right Sums

1 minute read

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...

Index Into an Infinite String

less than 1 minute read

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...

Increasing Digits

less than 1 minute read

Given an integer n, return the number of positive integers of length n such that the digits are strictly increasing.

In-Place Move Zeros to End of List

less than 1 minute read

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 ...

Hoppable

1 minute read

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...

Hit Counter

1 minute read

Implement a hit counter which keeps track of number of the number of hits in the last 60 seconds.

Highest Volume Stocks

1 minute read

Implement a data structure StockMarket which has the following methods: