CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 1371. Find the Longest Substring Containing Vowels in Even Counts

Given the string s, return the size of the longest substring containing each vowel an even number of times. That is, ‘a’, ‘e’, ‘i’, ‘o’, and ‘u’ must appear an even number of times. Example 1:Input: s
2020-05-20
#leetcode #java #prefix sum #string #bit manipulation

[LeetCode] 567. Permutation in String

Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise. In other words, return true if one of s1’s permutations is the substring of s2. Example 1:Input: s1 &#x
2020-05-19
#leetcode #two pointer #hashmap #java #sliding window #string

[LeetCode] 227. Basic Calculator II

Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should
2020-05-17
#leetcode #java #math #string #stack

[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 #hashmap #java #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 #array #java #javascript #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 #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
1…3031323334…46

Search

Hexo Fluid