摘要: 本博客不定期更新 LeetCode 题目总结,所有题目使用 Java 实现,小部分题目也提供 JavaScript 代码。a56爆大奖在线娱乐不追求一行 AC 但是a56爆大奖在线娱乐追求一题多解,比较常规的思路,解释清楚复杂度,代码可读性强。欢迎留言和评论,共同进步。这本是a56爆大奖在线娱乐自己用来复习的笔记,如果也能帮到你,那也是a56爆大奖在线娱乐的福报。 如果 阅读全文
posted @ 2020-03-18 09:02 CNoodle 阅读(2475) 评论(2) 推荐(1) 编辑
摘要: There are n balls on a table, each ball has a color black or white. You are given a 0-indexed binary string s of length n, where 1 and 0 represent bla 阅读全文
posted @ 2024-06-06 01:41 CNoodle 阅读(8) 评论(0) 推荐(0) 编辑
摘要: You have observations of n + m 6-sided dice rolls with each face numbered from 1 to 6. n of the observations went missing, and you only have the obser 阅读全文
posted @ 2024-05-27 04:23 CNoodle 阅读(3) 评论(0) 推荐(0) 编辑
摘要: You are given a 0-indexed integer array nums having length n, an integer indexDifference, and an integer valueDifference. Your task is to find two ind 阅读全文
posted @ 2024-05-26 13:09 CNoodle 阅读(1) 评论(0) 推荐(0) 编辑
摘要: You are given a 0-indexed integer array nums and an integer k. A subarray is called equal if all of its elements are equal. Note that the empty subarr 阅读全文
posted @ 2024-05-23 05:27 CNoodle 阅读(8) 评论(0) 推荐(0) 编辑
摘要: The XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty. For example, the XOR total of the array [2,5, 阅读全文
posted @ 2024-05-20 13:38 CNoodle 阅读(59) 评论(0) 推荐(0) 编辑
摘要: There are n projects numbered from 0 to n - 1. You are given an integer array milestones where each milestones[i] denotes the number of milestones the 阅读全文
posted @ 2024-05-16 07:11 CNoodle 阅读(13) 评论(0) 推荐(0) 编辑
摘要: You are given an array happiness of length n, and a positive integer k. There are n children standing in a queue, where the ith child has happiness va 阅读全文
posted @ 2024-05-10 05:13 CNoodle 阅读(5) 评论(0) 推荐(0) 编辑
摘要: You are given a 0-indexed integer array batteryPercentages having length n, denoting the battery percentages of n 0-indexed devices. Your task is to t 阅读全文
posted @ 2024-05-10 03:38 CNoodle 阅读(4) 评论(0) 推荐(0) 编辑
摘要: Alice and Bob want to water n plants in their garden. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the it 阅读全文
posted @ 2024-05-10 01:44 CNoodle 阅读(3) 评论(0) 推荐(0) 编辑
摘要: You want to water n plants in your garden with a watering can. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right whe 阅读全文
posted @ 2024-05-08 14:46 CNoodle 阅读(2) 评论(0) 推荐(0) 编辑
摘要: You are given the head of a linked list. Remove every node which has a node with a greater value anywhere to the right side of it. Return the head of 阅读全文
posted @ 2024-05-07 12:54 CNoodle 阅读(16) 评论(0) 推荐(0) 编辑
摘要: A truck has two fuel tanks. You are given two integers, mainTank representing the fuel present in the main tank in liters and additionalTank represent 阅读全文
posted @ 2024-04-25 04:47 CNoodle 阅读(10) 评论(0) 推荐(0) 编辑
摘要: There are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n - 1)th person is at the back of the l 阅读全文
posted @ 2024-04-10 03:48 CNoodle 阅读(10) 评论(0) 推荐(0) 编辑
摘要: You are given a positive integer n representing the number of nodes of a Directed Acyclic Graph (DAG). The nodes are numbered from 0 to n - 1 (inclusi 阅读全文
posted @ 2024-04-07 05:06 CNoodle 阅读(65) 评论(0) 推荐(0) 编辑
摘要: You are given an integer array nums and a positive integer k. Return the number of subarrays where the maximum element of nums appears at least k time 阅读全文
posted @ 2024-03-30 06:26 CNoodle 阅读(19) 评论(0) 推荐(0) 编辑
摘要: You are given a 0-indexed array nums consisting of positive integers. You can do the following operation on the array any number of times: Choose an i 阅读全文
posted @ 2024-03-14 15:41 CNoodle 阅读(15) 评论(0) 推荐(0) 编辑
摘要: You are given a string title consisting of one or more words separated by a single space, where each word consists of English letters. Capitalize the 阅读全文
posted @ 2024-03-11 12:39 CNoodle 阅读(6) 评论(0) 推荐(0) 编辑
摘要: You are given a 0-indexed string word of length n consisting of digits, and a positive integer m. The divisibility array div of word is an integer arr 阅读全文
posted @ 2024-03-07 14:01 CNoodle 阅读(5) 评论(0) 推荐(0) 编辑
摘要: Given a string s consisting only of characters 'a', 'b', and 'c'. You are asked to apply the following algorithm on the string any number of times: Pi 阅读全文
posted @ 2024-03-06 01:24 CNoodle 阅读(11) 评论(0) 推荐(0) 编辑
摘要: There is an undirected tree with n nodes labeled from 0 to n - 1 and n - 1 edges. You are given a 2D integer array edges of length n - 1 where edges[i 阅读全文
posted @ 2024-03-02 03:19 CNoodle 阅读(8) 评论(0) 推荐(0) 编辑