Leetcode

Leetcode Integer to Roman Java Solution

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…

2 years ago

Leetcode Container With Most Water Java Solution

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…

2 years ago

Leetcode Binary Tree Level Order Traversal II Java Solution

Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level…

2 years ago

Leetcode Unique Paths Java Solution

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…

2 years ago

Leetcode Perfect Squares Java Solution

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum…

2 years ago

Leetcode Regular Expression Matching Java Solution

Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Matches any single…

2 years ago

Leetcode ZigZag Conversion Java Solution

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display…

2 years ago

Leetcode Sum Root to Leaf Numbers Java Solution

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…

2 years ago

Leetcode Find the Duplicate Number Solution Java Solution

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…

2 years ago

Leetcode Unique Binary Search Trees Java Solution

Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example: Input: 3 Output: 5 Explanation: Given n…

2 years ago

This website uses cookies.