随笔分类 -  LeetCode

1 2 3 下一页

[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 (F 阅读全文

posted @ 2022-01-19 11:55 codingEskimo 阅读(49) 评论(0) 推荐(0)

[LeetCode] 232. Implement Queue using Stacks
摘要:mplement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek 阅读全文

posted @ 2022-01-17 06:56 codingEskimo 阅读(27) 评论(0) 推荐(0)

[LeetCode] 225. Implement Stack using Queues
摘要:Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, 阅读全文

posted @ 2022-01-17 06:18 codingEskimo 阅读(16) 评论(0) 推荐(0)

[LeetCode] 155. Min Stack
摘要:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class: MinStack() initializes 阅读全文

posted @ 2022-01-16 08:04 codingEskimo 阅读(32) 评论(0) 推荐(0)

[LeetCode] 92. Reverse Linked List II
摘要:Given the head of a singly linked list and two integers left and right where left ⇐ right, reverse the nodes of the list from position left to positio 阅读全文

posted @ 2022-01-12 05:57 codingEskimo 阅读(47) 评论(0) 推荐(0)

[LeetCode] 203. Remove Linked List Elements
摘要:Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head. Example 阅读全文

posted @ 2022-01-12 04:04 codingEskimo 阅读(33) 评论(0) 推荐(0)

[LeetCode] 113. Path Sum II
摘要:Given the root of a binary tree and an integer targetSum, return all root-to-leaf paths where the sum of the node values in the path equals targetSum. 阅读全文

posted @ 2022-01-09 02:04 codingEskimo 阅读(30) 评论(0) 推荐(0)

[LeetCode] 112. Path Sum
摘要:Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the 阅读全文

posted @ 2022-01-09 01:49 codingEskimo 阅读(32) 评论(0) 推荐(0)

[LeetCode] 98. Validate Binary Search Tree
摘要:Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: The left subtree of a node co 阅读全文

posted @ 2022-01-09 01:38 codingEskimo 阅读(29) 评论(0) 推荐(0)

[LeetCode] 110. Balanced Binary Tree
摘要:Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the lef 阅读全文

posted @ 2022-01-09 01:13 codingEskimo 阅读(33) 评论(0) 推荐(0)

[LeetCode] 102. Binary Tree Level Order Traversal
摘要:Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). Example1: Input: r 阅读全文

posted @ 2022-01-05 07:48 codingEskimo 阅读(26) 评论(0) 推荐(0)

[LeetCode] 104. Construct Binary Tree from Preorder and Inorder Traversal
摘要:Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the sa 阅读全文

posted @ 2021-12-29 11:11 codingEskimo 阅读(27) 评论(0) 推荐(0)

[LeetCode] 101. Symmetric Tree
摘要:Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Example 1: Input: root = [1,2,2,3,4,4,3] 阅读全文

posted @ 2021-12-29 10:08 codingEskimo 阅读(22) 评论(0) 推荐(0)

[LeetCode] 100. Same Tree
摘要:Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they a 阅读全文

posted @ 2021-12-29 09:55 codingEskimo 阅读(28) 评论(0) 推荐(0)

[LeetCode] 23. Merge k Sorted Lists
摘要:You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list 阅读全文

posted @ 2021-12-28 07:09 codingEskimo 阅读(40) 评论(0) 推荐(0)

[LeetCode] 191. Number of 1 Bits
摘要:Write a function that takes an unsigned integer and return the number of '1' bits it has (also known as the Hamming weight). Example 1: Example 2: Exa 阅读全文

posted @ 2020-04-24 02:28 codingEskimo 阅读(86) 评论(0) 推荐(0)

[LeetCode] 260. Single Number III
摘要:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements 阅读全文

posted @ 2020-04-24 02:11 codingEskimo 阅读(80) 评论(0) 推荐(0)

[LeetCode] 200. Number of Islands
摘要:Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文

posted @ 2020-04-18 05:08 codingEskimo 阅读(321) 评论(0) 推荐(0)

[LeetCode] 678. Valid Parenthesis String
摘要:Given a string containing only three types of characters: '(', ')' and ' ', write a function to check whether this string is valid. We define the vali 阅读全文

posted @ 2020-04-17 10:00 codingEskimo 阅读(191) 评论(0) 推荐(0)

[LeetCode] 238. Product of Array Except Self
摘要:Given an array nums of n integers where n 1, return an array output such that output[i] is equal to the product of all the elements of nums except num 阅读全文

posted @ 2020-04-16 07:53 codingEskimo 阅读(114) 评论(0) 推荐(0)

1 2 3 下一页

导航