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 50 C 100…
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of…
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level…
Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum…
Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Matches any single…
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display…
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which…
Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wikipedia:In a complete binary tree…
Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one. Note: Your…
There are n cities connected by m flights. Each flight starts from city u and arrives at v with a price w. Now…
This website uses cookies.