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] 139. Word Break

Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. Note:The sam
2020-05-13
#leetcode #hashmap #java #javascript #dynamic programming #string

[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] 463. Island Perimeter

You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water. Grid cells are connected horizontally/vertically (not diagonall
2020-05-08
#leetcode #hashmap #java #javascript
1…3132333435…47

Search

Hexo Fluid