CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 1291. Sequential Digits

An integer has sequential digits if and only if each digit in the number is one more than the previous digit. Return a sorted list of all the integers in the range [low, high] inclusive that have sequ
2020-09-20
#leetcode #java #bfs #dfs #enumeration

[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] 299. Bulls and Cows

You are playing the Bulls and Cows game with your friend. You write down a secret number and ask your friend to guess what the number is. When your friend makes a guess, you provide a hint with the fo
2020-09-11
#leetcode #hashmap #java #string

[LeetCode] 1022. Sum of Root To Leaf Binary Numbers

You are given the root of a binary tree where each node has a value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit. For example, if the path is 0 ->
2020-09-09
#leetcode #java #tree #dfs #preorder #recursion

[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-08-01
#leetcode #array #java #greedy #heap
1…2728293031…47

Search

Hexo Fluid