Tag: c++
The puzzle is to generate the first few numRows rows of Pascal’s Triangle. Do you need to keep each row in separate variables (row vector)? Apparently no. The trick …
Pascal Triangle is a triangle made of numbers. The first row (root) has only 1 number which is 1, the second row has 2 numbers which again are 1 …
Polish notation/expression is also known as ‘prefix notation’ where the numbers are preceded by its operator (placed in the front). For example, “3 * 5” transformed to polish notation …
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input …
Given an array of integers, every element appears twice except for one. Find that single one. Your algorithm should have a linear runtime complexity. Implement it without using extra …