From 5364b2a8056a0caba466e8ac4c9abe659337871b Mon Sep 17 00:00:00 2001 From: Vamsi-2581 <245859299+Vamsi-2581@users.noreply.github.com> Date: Mon, 9 Nov 2026 20:26:19 +0530 Subject: [PATCH 1/2] test(python): add test cases for practice294 getMinDistance Added test cases to validate the getMinDistance method. --- solutions/python/practice294.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/solutions/python/practice294.py b/solutions/python/practice294.py index cfa46aa..2f15d17 100644 --- a/solutions/python/practice294.py +++ b/solutions/python/practice294.py @@ -14,3 +14,12 @@ def getMinDistance(self, nums, target, start): closest = min(closest, abs(start - i)) return closest +# Test cases +sol = Solution() +assert sol.getMinDistance([1, 2, 3, 4, 5], 5, 3) == 1 +assert sol.getMinDistance([1], 1, 0) == 0 +assert sol.getMinDistance([1, 1, 1, 1, 1], 1, 0) == 0 +assert sol.getMinDistance([5, 3, 6], 5, 2) == 2 +assert sol.getMinDistance([1, 2, 3, 4, 5, 3], 3, 4) == 1 + +print("All test cases passed!") From 3a3aae90bdd8ca895451c8a7c73581a936d5e9ad Mon Sep 17 00:00:00 2001 From: Vamsi-2581 <245859299+Vamsi-2581@users.noreply.github.com> Date: Mon, 9 Nov 2026 20:57:49 +0530 Subject: [PATCH 2/2] fix(header): align 3-line metadata header with repository validator Updated the comment header for clarity and removed unnecessary line. --- solutions/python/practice294.py | 1 - 1 file changed, 1 deletion(-) diff --git a/solutions/python/practice294.py b/solutions/python/practice294.py index 2f15d17..1372597 100644 --- a/solutions/python/practice294.py +++ b/solutions/python/practice294.py @@ -1,4 +1,3 @@ -# Minimum Distance to the Target Element # Problem: Minimum Distance to the Target Element # Source: https://leetcode.com/problems/minimum-distance-to-the-target-element/ # Note: Finds the minimum absolute distance between start and an index containing target.