CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 224. Basic Calculator

Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers and empty spa
2020-05-17
#leetcode #java #math #string #stack

[LeetCode] 981. Time Based Key-Value Store

Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key’s value at a certain timestamp. Implement the TimeMap class:
2020-05-16
#leetcode #java #hashmap #treemap #string #binary search #design

[LeetCode] 85. Maximal Rectangle

Given a rows x cols binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area. Example 1:Input: matrix = [ [“1”,”0”,”1”,”0”,”0”], [“1”,”0”,”1
2020-05-15
#leetcode #java #javascript #array #stack #monotonic stack

[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 #java #array #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 #java #array #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 #tree #bfs #java #hashmap

[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 #tree #bfs #java #javascript #hashmap

[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
1…2829303132…43

Search

Hexo Fluid