Skip to content

Commit 93d90bf

Browse files
authored
Update Solution.ts
1 parent 7797047 commit 93d90bf

File tree

1 file changed

+3
-3
lines changed
  • solution/1500-1599/1509.Minimum Difference Between Largest and Smallest Value in Three Moves

1 file changed

+3
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
function minDifference(nums: number[]): number {
2-
if (nums.length < 5) return 0;
2+
if (nums.length < 5) {
3+
return 0;
4+
}
35
nums.sort((a, b) => a - b);
46
let ans = Number.POSITIVE_INFINITY;
5-
67
for (let i = 0; i < 4; i++) {
78
ans = Math.min(ans, nums.at(i - 4)! - nums[i]);
89
}
9-
1010
return ans;
1111
}

0 commit comments

Comments
 (0)