Weekly Contest 351 周赛题目解析

Posted on Sun 25 June 2023 in Leetcode • Tagged with Contest

2023-06 Leetcode Weekly Contest 351 第 351 场力扣周赛 | 2748. Number of Beautiful Pairs 美丽下标对的数目 | 2749. Minimum Operations to Make the Integer Zero 得到整数零需要执行的最少操作数 | 2750. Ways to Split Array Into Good Subarrays 将数组划分成若干好子数组的方式 | 2751. Robot Collisions 机器人碰撞 | Solution to contest problems 赛题讲解


Continue reading

Weekly Contest 350 周赛题目解析

Posted on Sun 18 June 2023 in Leetcode • Tagged with Contest

2023-06 Leetcode Weekly Contest 350 第 350 场力扣周赛 | 2739. Total Distance Traveled 总行驶距离 | 2740. Find the Value of the Partition 找出分区值 | 2741. Special Permutations 特别的排列 | 2742. Painting the Walls 给墙壁刷油漆 | Solution to contest problems 赛题讲解 | Weighted Graph 有权图


Continue reading

327. Count of Range Sum 区间和的个数

Posted on Sat 10 June 2023 in Leetcode

Leetcode Medium 327. Count of Range Sum 区间和的个数 | Binary Search 二分搜索 | Divide and Conquer 分治算法 | Merge Sort 归并排序


Continue reading

Weekly Contest 346 周赛题目解析

Posted on Sun 21 May 2023 in Leetcode • Tagged with Contest

2023-05 Leetcode Weekly Contest 346 第 346 场力扣周赛 | 2696. Minimum String Length After Removing Substrings 删除子串后的字符串最小长度 | 2697. Lexicographically Smallest Palindrome 字典序最小回文串 | 2698. Find the Punishment Number of an Integer 求一个整数的惩罚数 | 2699. Modify Graph Edge Weights 修改图中的边权 | Solution to contest problems 赛题讲解 | Weighted Graph 有权图


Continue reading

Weekly Contest 345 周赛题目解析

Posted on Thu 18 May 2023 in Leetcode • Tagged with Contest

2023-05 Leetcode Weekly Contest 345 第 345 场力扣周赛 | 2682. Find the Losers of the Circular Game 找出转圈游戏输家 | 2683. Neighboring Bitwise XOR 相邻值的按位异或 | 2684. Maximum Number of Moves in a Grid 矩阵中移动的最大次数 | 2685. Count the Number of Complete Components 统计完全连通分量的数量 | Solution to contest problems 赛题讲解 | 异或 XOR |


Continue reading

解决Foobar挑战(三)

Posted on Sat 13 May 2023 in Computer Science • Tagged with Google Foobar

接上回书,我们来到了Foobar挑战的第四层,题目越来越困难了。这篇文章给出了Foobar Level 4 的两道题 Running with Bunnies 和 Distract the Trainers 的解题思路和python代码。这一层要求我们掌握图相关的算法,包括Dijkstra,Floyd-Warshall,以及二分图和网络流算法,如匈牙利算法和Hopcroft-Karp算法。


Continue reading

Weekly Contest 344 周赛题目解析

Posted on Mon 08 May 2023 in Leetcode • Tagged with Contest

2023-05 Leetcode Weekly Contest 344 第 344 场力扣周赛 | 2670. Find the Distinct Difference Array 找出不同元素数目差数组 | 2671. Frequency Tracker 频率跟踪器 | 2672. Number of Adjacent Elements With the Same Color 有相同颜色的相邻元素数目 | 2663. Lexicographically Smallest Beautiful String 字典序最小的美丽字符串 | Solution to contest problems 赛题讲解 | Dijkstra's Algorithm 狄克斯特拉算法 | Lexicographic order 字典序


Continue reading

【Leetcode题解】Weekly Contest 343 周赛题目解析

Posted on Thu 04 May 2023 in Leetcode • Tagged with Contest

2023-04 Leetcode Weekly Contest 343 第 343 场力扣周赛 | 2660. Determine the Winner of a Bowling Game 保龄球游戏的获胜者 | 2661. First Completely Painted Row or Column 找出叠涂元素 | 2663. Lexicographically Smallest Beautiful String 字典序最小的美丽字符串 | 2663. Lexicographically Smallest Beautiful String 字典序最小的美丽字符串 | Solution to contest problems 赛题讲解 | Dijkstra's Algorithm 狄克斯特拉算法 | Lexicographic order 字典序


Continue reading

【Leetcode题解】Biweekly Contest 103 双周赛题目解析

Posted on Mon 01 May 2023 in Leetcode • Tagged with Contest

2023-04 Leetcode Biweekly Contest 103 | 2656. Maximum Sum With Exactly K Elements K 个元素的最大和 | 2657. Find the Prefix Common Array of Two Arrays 找到两个数组的前缀公共数组 | 2658. Maximum Number of Fish in a Grid 网格图中鱼的最大数目 | 2659. Make Array Empty 将数组清空 | Solution to contest problems 赛题讲解 | DFS 深度优先搜索


Continue reading

【Leetcode题解】Weekly Contest 342 周赛题目解析

Posted on Sun 23 April 2023 in Leetcode • Tagged with Contest

2023-04 Leetcode Weekly Contest 342 第 342 场力扣周赛 | 2651. Calculate Delayed Arrival Time 计算列车到站时间 | 2652. Sum Multiples 倍数求和 | 2653. Sliding Subarray Beauty 滑动子数组的美丽值 | 2654. Minimum Number of Operations to Make All Array Elements Equal to 1 使数组所有元素变成 1 的最少操作次数 | Solution to contest problems 赛题讲解 | 快速选择 Quickselect | DFS | 最大公约数 Greatest Common Divisor


Continue reading