CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 421. Maximum XOR of Two Numbers in an Array

Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n.Example 1:Input: nums = [3,10,5,25,2,8]Output: 28Explanation: The maximum r
2020-09-17
#leetcode #java #bit manipulation #trie

[LeetCode] 875. Koko Eating Bananas

Koko loves to eat bananas. There are N piles of bananas, the i-th pile has piles[i] bananas. The guards have gone and will come back in H hours. Koko can decide her bananas-per-hour eating speed of
2020-09-09
#leetcode #array #java #binary search #binary search on answer

[LeetCode] 223. Rectangle Area

Given the coordinates of two rectilinear rectangles in a 2D plane, return the total area covered by the two rectangles. The first rectangle is defined by its bottom-left corner (ax1, ay1) and its top-
2020-09-07
#leetcode #java #math #geometry

[LeetCode] 429. N-ary Tree Level Order Traversal

Given an n-ary tree, return the level order traversal of its nodes’ values. Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null
2020-09-07
#leetcode #java #tree #bfs

590. N-ary Tree Postorder Traversal

Given the root of an n-ary tree, return the postorder traversal of its nodes’ values. Nary-Tree input serialization is represented in their level order traversal. Each group of children is separated b
2020-08-13
#leetcode #java #tree #postorder #n-ary tree

[LeetCode] 622. Design Circular Queue

Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle, and the last positio
2020-08-03
#leetcode #array #java #design #queue

[LeetCode] 373. Find K Pairs with Smallest Sums

You are given two integer arrays nums1 and nums2 sorted in non-decreasing order and an integer k. Define a pair (u, v) which consists of one element from the first array and one element from the secon
2020-07-31
#leetcode #array #java #greedy #heap

[LeetCode] 437. Path Sum III

Given the root of a binary tree and an integer targetSum, return the number of paths where the sum of the values along the path equals targetSum. The path does not need to start or end at the root or
2020-07-30
#leetcode #java #tree #preorder #prefix sum

[LeetCode] 529. Minesweeper

Let’s play the minesweeper game (Wikipedia, online game)! You are given an m x n char matrix board representing the game board where: ‘M’ represents an unrevealed mine,‘E’ represents an unrevealed emp
2020-07-23
#leetcode #array #java #dfs #matrix

[LeetCode] 417. Pacific Atlantic Water Flow

There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island’s left and top edges, and the Atlantic Ocean touches the island’s righ
2020-07-23
#leetcode #java #bfs #dfs #flood fill
1…2526272829…43

Search

Hexo Fluid