[LeetCode] Beautiful Pairs

2613. Beautiful Pairs

You are given two 0-indexed integer arrays nums1 and nums2 of the same length. A pair of indices (i,j) is called beautiful if|nums1[i] - nums1[j]| + |nums2[i] - nums2[j]| is the smallest amongst all possible indices pairs where i < j.

Return the beautiful pair. In the case that there are multiple beautiful pairs, return the lexicographically smallest pair.

Note that

  • |x| denotes the absolute value of x.
  • A pair of indices (i1, j1) is lexicographically smaller than (i2, j2) if i1 < i2 or i1 == i2 and j1 < j2.
Read more
[CS Academy] Even SubsetRead more
[CS Academy] Falling BallsRead more
[CS Academy] Free PalindromesRead more
[CS Academy] Least Even DigitsRead more
[CS Academy] Bunny on Number LineRead more
[AtCoder] F - 誤情報Read more
[AtCoder] D - ぽよぽよRead more
[AtCoder] C - 有向グラフRead more
[AtCoder] C - 仕事計画Read more