CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 119. Pascal's Triangle II

Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal’s triangle. In Pascal’s triangle, each number is the sum of the two numbers directly above it as shown: Example 1:Input:
2020-05-14
#leetcode #array #java #math

[LeetCode] 118. Pascal's Triangle

Given an integer numRows, return the first numRows of Pascal’s triangle. In Pascal’s triangle, each number is the sum of the two numbers directly above it as shown: Example 1:Input: numRows = 5Ou
2020-05-14
#leetcode #array #java #math

[LeetCode] 402. Remove K Digits

Given string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removing k digits from num. Example 1:Input: num = “1432219”, k = 3Outp
2020-05-14
#leetcode #java #javascript #greedy #string #stack #monotonic stack

[LeetCode] 987. Vertical Order Traversal of a Binary Tree

Given the root of a binary tree, calculate the vertical order traversal of the binary tree. For each node at position (row, col), its left and right children will be at positions (row + 1, col - 1) an
2020-05-13
#leetcode #hashmap #java #tree #bfs

[LeetCode] 314. Binary Tree Vertical Order Traversal

Given the root of a binary tree, return the vertical order traversal of its nodes’ values. (i.e., from top to bottom, column by column). If two nodes are in the same row and column, the order should b
2020-05-13
#leetcode #hashmap #java #javascript #tree #bfs

[LeetCode] 1441. Build an Array With Stack Operations

You are given an integer array target and an integer n.You have an empty stack with the two following operations:“Push”: pushes an integer to the top of the stack.“Pop”: removes the integer on the top
2020-05-11
#leetcode #java #simulation

[LeetCode] 277. Find the Celebrity

Suppose you are at a party with n people labeled from 0 to n - 1 and among them, there may exist one celebrity. The definition of a celebrity is that all the other n - 1 people know the celebrity, but
2020-05-11
#leetcode #java #graph

[LeetCode] 997. Find the Town Judge

In a town, there are n people labeled from 1 to n. There is a rumor that one of these people is secretly the town judge. If the town judge exists, then:The town judge trusts nobody.Everybody (except f
2020-05-11
#leetcode #hashmap #java #graph

[LeetCode] 1249. Minimum Remove to Make Valid Parentheses

Given a string s of ‘(‘ , ‘)’ and lowercase English characters. Your task is to remove the minimum number of parentheses ( ‘(‘ or ‘)’, in any positions ) so that the resulting parentheses string is va
2020-05-08
#leetcode #java #string #stack

[LeetCode] 84. Largest Rectangle in Histogram

Given an array of integers heights representing the histogram’s bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram. Example 1:Input: heights =
2020-05-08
#leetcode #array #java #javascript #stack #monotonic stack
1…2728293031…41

Search

Hexo Fluid