244. Shortest Word Distance II

Problem description:

Design a class which receives a list of words in the constructor, and implements a method that takes two words word1 and word2 and return the shortest distance between these two words in the list. Your method will be called repeatedly many times with different parameters.

Readmore

739. Daily Temperatures

Problem description:

Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If there is no future day for which this is possible, put 0 instead.

Readmore

149. Max Points on a Line

Problem description:

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.

Readmore

57. Insert Interval

Problem description:

Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).

Readmore

126. Word Ladder II

Problem description:

Given two words (beginWord and endWord), and a dictionary’s word list, find all shortest transformation sequence(s) from beginWord to endWord, such that:

Readmore

154. Find Minimum in Rotated Sorted Array II

Problem description:

Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.

Readmore

C++ 11 lambda function

In C++ 11, a lambda expression is a convenient way of defining an anonymous function object right at the location where it is invoked or passed as an argument to a function.

Readmore

56. Merge Intervals

Problem description:

Given a collection of intervals, merge all overlapping intervals.

Readmore

238. Product of Array Except Self

Problem description:

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].

Readmore

123. Best Time to Buy and Sell Stock III

Problem description:

Say you have an array for which the ith element is the price of a given stock on day i.

Readmore