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…
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only…
Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order.…
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 an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must…
The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists…
Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. Example: Input: 3 Output:…
This website uses cookies.