There are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n – …
My memo and playground
There are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n – …
The school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively. All studen…
There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings. You are giving candi…
Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and…
The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a f…
Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words&n…
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string “”. E…
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after …
Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maxi…
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L…