leetcode.cn 2026-04-12
🔴1320.minimum-distance-to-type-a-word-using-two-fingers
🏷️ Tags
#string #dynamic_programming
🔴1320.minimum-distance-to-type-a-word-using-two-fingers
🏷️ Tags
#string #dynamic_programming
Telegraph
minimum-distance-to-type-a-word-using-two-fingers
二指输入法定制键盘在 X-Y 平面上的布局如上图所示,其中每个大写英文字母都位于某个坐标处。
leetcode.com 2026-04-12
🔴1320.minimum-distance-to-type-a-word-using-two-fingers
🏷️ Tags
#string #dynamic_programming
🔴1320.minimum-distance-to-type-a-word-using-two-fingers
🏷️ Tags
#string #dynamic_programming
Telegraph
minimum-distance-to-type-a-word-using-two-fingers
You have a keyboard layout as shown above in the X-Y plane, where each English uppercase letter is located at some coordinate.
leetcode.cn 2026-04-14
🔴2463.minimum-total-distance-traveled
🏷️ Tags
#array #dynamic_programming #sorting
🔴2463.minimum-total-distance-traveled
🏷️ Tags
#array #dynamic_programming #sorting
Telegraph
minimum-total-distance-traveled
X 轴上有一些机器人和工厂。给你一个整数数组 robot ,其中 robot[i] 是第 i 个机器人的位置。再给你一个二维整数数组 factory ,其中 factory[j] = [positionj, limitj] ,表示第 j 个工厂的位置在 positionj ,且第 j 个工厂最多可以修理 limitj 个机器人。 每个机器人所在的位置 互不相同 。每个工厂所在的位置也 互不相同 。注意一个机器人可能一开始跟一个工厂在 相同的位置 。 所有机器人一开始都是坏的,他们会沿着设定的方向一直移动。设定的方向要么是…
leetcode.com 2026-04-14
🔴2463.minimum-total-distance-traveled
🏷️ Tags
#array #dynamic_programming #sorting
🔴2463.minimum-total-distance-traveled
🏷️ Tags
#array #dynamic_programming #sorting
Telegraph
minimum-total-distance-traveled
There are some robots and factories on the X-axis. You are given an integer array robot where robot[i] is the position of the ith robot. You are also given a 2D integer array factory where factory[j] = [positionj, limitj] indicates that positionj is the position…
leetcode.cn 2026-04-15
🟢2515.shortest-distance-to-target-string-in-a-circular-array
🏷️ Tags
#array #string
🟢2515.shortest-distance-to-target-string-in-a-circular-array
🏷️ Tags
#array #string
Telegraph
shortest-distance-to-target-string-in-a-circular-array
给你一个下标从 0 开始的 环形 字符串数组 words 和一个字符串 target 。环形数组 意味着数组首尾相连。
leetcode.com 2026-04-15
🟢2515.shortest-distance-to-target-string-in-a-circular-array
🏷️ Tags
#array #string
🟢2515.shortest-distance-to-target-string-in-a-circular-array
🏷️ Tags
#array #string
Telegraph
shortest-distance-to-target-string-in-a-circular-array
You are given a 0-indexed circular string array words and a string target. A circular array means that the array's end connects to the array's beginning.
leetcode.cn 2026-04-17
🟡3761.minimum-absolute-distance-between-mirror-pairs
🏷️ Tags
#array #hash_table #math
🟡3761.minimum-absolute-distance-between-mirror-pairs
🏷️ Tags
#array #hash_table #math
Telegraph
minimum-absolute-distance-between-mirror-pairs
给你一个整数数组 nums。
leetcode.com 2026-04-17
🟡3761.minimum-absolute-distance-between-mirror-pairs
🏷️ Tags
#array #hash_table #math
🟡3761.minimum-absolute-distance-between-mirror-pairs
🏷️ Tags
#array #hash_table #math
Telegraph
minimum-absolute-distance-between-mirror-pairs
You are given an integer array nums. A mirror pair is a pair of indices (i, j) such that:
leetcode.cn 2026-04-19
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
Telegraph
maximum-distance-between-a-pair-of-values
给你两个 非递增 的整数数组 nums1 和 nums2 ,数组下标均 从 0 开始 计数。 下标对 (i, j) 中 0 <= i < nums1.length 且 0 <= j < nums2.length 。如果该下标对同时满足 i <= j 且 nums1[i] <= nums2[j] ,则称之为 有效 下标对,该下标对的 距离 为 j - i 。 返回所有 有效 下标对 (i, j) 中的 最大距离 。如果不存在有效下标对,返回 0 。 一个数组 arr ,如果每个…
leetcode.com 2026-04-19
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
Telegraph
maximum-distance-between-a-pair-of-values
You are given two non-increasing 0-indexed integer arrays nums1 and nums2. A pair of indices (i, j), where 0 <= i < nums1.length and 0 <= j < nums2.length, is valid if both i <= j and nums1[i] <= nums2[j]. The distance of the pair is j - i.…
leetcode.cn 2026-04-21
🟡1722.minimize-hamming-distance-after-swap-operations
🏷️ Tags
#depth_first_search #union_find #array
🟡1722.minimize-hamming-distance-after-swap-operations
🏷️ Tags
#depth_first_search #union_find #array
Telegraph
minimize-hamming-distance-after-swap-operations
给你两个整数数组 source 和 target ,长度都是 n 。还有一个数组 allowedSwaps ,其中每个 allowedSwaps[i] = [ai, bi] 表示你可以交换数组 source 中下标为 ai 和 bi(下标从 0 开始)的两个元素。注意,你可以按 任意 顺序 多次 交换一对特定下标指向的元素。 相同长度的两个数组 source 和 target 间的 汉明距离 是元素不同的下标数量。形式上,其值等于满足 source[i] != target[i] (下标从 0 开始)的下标…
leetcode.com 2026-04-21
🟡1722.minimize-hamming-distance-after-swap-operations
🏷️ Tags
#depth_first_search #union_find #array
🟡1722.minimize-hamming-distance-after-swap-operations
🏷️ Tags
#depth_first_search #union_find #array
Telegraph
minimize-hamming-distance-after-swap-operations
You are given two integer arrays, source and target, both of length n. You are also given an array allowedSwaps where each allowedSwaps[i] = [ai, bi] indicates that you are allowed to swap the elements at index ai and index bi (0-indexed) of array source.…