Coding Interview Questions

Pascal’s triangle 2

Before solving this, have a look at similar problem “pascal’s triangle”. Given a non-negative integer numRows, generate the first numRows of…

Insert Interval

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

Decode Ways

A message containing letters from A-Z is being encoded to numbers using the following mapping: ‘A’ -> 1 ‘B’ -> 2…

Subsets II in CPP

Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must…