Skip to content

Commit cd12ccc

Browse files
authored
Update 1984-Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.js
Added a descriptive edge case.
1 parent ceb948a commit cd12ccc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

javascript/1984-Minimum-Difference-Between-Highest-and-Lowest-of-K-Scores.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
*/
1010
var minimumDifference = function(nums, k) {
1111

12-
if (k === 1) return 0;
12+
const isEdgeCase = (k === 1);
13+
if (isEdgeCase) return 0;
1314

1415
nums = nums.sort((a, b) => {
1516
return a - b;

0 commit comments

Comments
 (0)