摘要:
原题链接在这里:https://leetcode.com/problems/swapping-nodes-in-a-linked-list/ 题目: You are given the head of a linked list, and an integer k. Return the head 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/maximum-twin-sum-of-a-linked-list/ 题目: In a linked list of size n, where n is even, the ith node (0-indexed) of 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/k-radius-subarray-averages/ 题目: You are given a 0-indexed array nums of n integers, and an integer k. The k-radi 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/minimum-operations-to-reduce-x-to-zero/ 题目: You are given an integer array nums and an integer x. In one operati 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/find-a-peak-element-ii/ 题目: A peak element in a 2D grid is an element that is strictly greater than all of its a 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/ip-to-cidr/ 题目: An IP address is a formatted 32-bit unsigned integer where each group of 8 bits is printed as a 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/remove-vowels-from-a-string/ 题目: Given a string s, remove the vowels 'a', 'e', 'i', 'o', and 'u' from it, and re 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/count-sub-islands/ 题目: You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/minimum-insertions-to-balance-a-parentheses-string/ 题目: Given a parentheses string s containing only the charact 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced/ 题目: You are given a 0-indexed string s of even length n. Th 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/delete-the-middle-node-of-a-linked-list/ 题目: You are given the head of a linked list. Delete the middle node, an 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iv/ 题目: Given the root of a binary tree and an array of TreeNode objects 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iii/ 题目: Given two nodes of a binary tree p and q, return their lowest c 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-ii/ 题目: Given the root of a binary tree, return the lowest common ancest 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/iterator-for-combination/ 题目: Design the CombinationIterator class: CombinationIterator(string characters, int c 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/prefix-and-suffix-search/ 题目: Design a special dictionary which has some words and allows you to search the word 阅读全文
摘要:
JavaScipt Stack declear: []. pop an empty stack in JavaScipt return undefined 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/rotate-string/ 题目: We are given two strings, A and B. A shift on A consists of taking string A and moving the le 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/flower-planting-with-no-adjacent/ 题目: You have N gardens, labelled 1 to N. In each garden, you want to plant one 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/implement-rand10-using-rand7/ 题目: Given a function rand7 which generates a uniform random integer in the range 1 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/count-different-palindromic-subsequences/ 题目: Given a string S, find the number of different non-empty palindrom 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/validate-stack-sequences/ 题目: Given two sequences pushed and popped with distinct values, return true if and onl 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/product-of-the-last-k-numbers/ 题目: Implement the class ProductOfNumbers that supports two methods: 1. add(int nu 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/flip-string-to-monotone-increasing/ 题目: A string of '0's and '1's is monotone increasing if it consists of some 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/shortest-path-in-a-grid-with-obstacles-elimination/ 题目: Given a m * n grid, where each cell is either 0 (empty) 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps/ 题目: You have a pointer at index 0 in an array of size 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/similar-string-groups/ 题目: Two strings X and Y are similar if we can swap two letters (in different positions) o 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/confusing-number-ii/ 题目: We can rotate digits by 180 degrees to form new digits. When 0, 1, 6, 8, 9 are rotated 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/confusing-number/ 题目: Given a number N, return true if and only if it is a confusing number, which satisfies the 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/string-transforms-into-another-string/ 题目: Given two strings str1 and str2 of the same length, determine whether 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/parallel-courses/ 题目: There are N courses, labelled from 1 to N. We are given relations[i] = [X, Y], representin 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/tree-diameter/ 题目: Given an undirected tree, return its diameter: the number of edges in a longest path in that 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/analyze-user-website-visit-pattern/ 题目: We are given some website visits: the user with name username[i] visited 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/dice-roll-simulation/ 题目: A die simulator generates a random number from 1 to 6 for each roll. You introduced a 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/sort-an-array/ 题目: Given an array of integers nums, sort the array in ascending order. Example 1: Input: nums = 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/cousins-in-binary-tree/ 题目: In a binary tree, the root node is at depth 0, and children of each depth k node are 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/ 题目: Given a string S of lowercase letters, a duplicate removal consist 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/elimination-game/ 题目: There is a list of sorted integers from 1 to n. Starting from left to right, remove the fi 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/ 题目: Given a string s, a k duplicate removal consists of choosing k 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/all-paths-from-source-to-target/ 题目: Given a directed, acyclic graph of N nodes. Find all possible paths from no 阅读全文