4168 Mirror Distance Of An Integer
Mirror Distance of an Integer You are given an integer n. Define its mirror distance as: abs(n - reverse(n)) where reverse(n) is the integer formed by reversing the digits of n. Return a...
Mirror Distance of an Integer You are given an integer n. Define its mirror distance as: abs(n - reverse(n)) where reverse(n) is the integer formed by reversing the digits of n. Return a...
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: 0 <= i < j < nums.length, and reverse(nums[i]) ...
Closest Equal Element Queries You are given a circular array nums and an array queries. For each query i, you have to find the following: The **minimum** distance between the element at index q...
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...
Minimum Distance to the Target Element Given an integer array nums (0-indexed) and two integers target and start, find an index i such that nums[i] == target and abs(i - start) is minimized. Note...
Minimum Distance Between Three Equal Elements II You are given an integer array nums. A tuple (i, j, k) of 3 distinct indices is good if nums[i] == nums[j] == nums[k]. The distance of a good tu...
Minimum Distance Between Three Equal Elements I You are given an integer array nums. A tuple (i, j, k) of 3 distinct indices is good if nums[i] == nums[j] == nums[k]. The distance of a good tup...
XOR After Range Multiplication Queries II You are given an integer array nums of length n and a 2D integer array queries of size q, where queries[i] = [li, ri, ki, vi]. Create the variable named...
XOR After Range Multiplication Queries I You are given an integer array nums of length n and a 2D integer array queries of size q, where queries[i] = [li, ri, ki, vi]. For each query, you must a...
Walking Robot Simulation A robot on an infinite XY-plane starts at point (0, 0) facing north. The robot receives an array of integers commands, which represents a sequence of moves that it needs ...