消息推送Leetcode每日一题 —— 3882. 网格图中最小异或路径2小时前Leetcode每日一题 —— 3882. 网格图中最小异或路径🌐 链接: https://linux.do/t/topic/3084110🏷️ 分组: LinuxDo论坛🕒 时间: 2026-10-28 09:16:35 LINUX DO Leetcode每日一题 —— 3882. 网格图中最小异或路径 思路 朴素方案,标准DP。 把每个左网格和上网格的可能值都进行异或后存到HashSet中。 代码 class Solution { public int minCost(int[][] grid) { int m = grid.length; int n = grid[0].length; HashSet<Integer>[] dp = new HashSet[n]; HashSet<Integer>tmp = new HashSet<>();… 2小时前