Skip to content

Commit 7828e29

Browse files
author
openset
committed
Add: Minimum Moves to Equal Array Elements
1 parent 2143f5c commit 7828e29

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ LeetCode Problems' Solutions
6262

6363
| # | Title | Solution | Difficulty |
6464
| :-: | - | - | :-: |
65+
| <span id="1285">1285</span> | [Find the Start and End Number of Continuous Ranges](https://leetcode.com/problems/find-the-start-and-end-number-of-continuous-ranges) 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/find-the-start-and-end-number-of-continuous-ranges) | Medium |
6566
| <span id="1284">1284</span> | [Minimum Number of Flips to Convert Binary Matrix to Zero Matrix](https://leetcode.com/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix "转化为全零矩阵的最少反转次数") | [Go](https://github.com/openset/leetcode/tree/master/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix) | Hard |
6667
| <span id="1283">1283</span> | [Find the Smallest Divisor Given a Threshold](https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold "使结果不超过阈值的最小除数") | [Go](https://github.com/openset/leetcode/tree/master/problems/find-the-smallest-divisor-given-a-threshold) | Medium |
6768
| <span id="1282">1282</span> | [Group the People Given the Group Size They Belong To](https://leetcode.com/problems/group-the-people-given-the-group-size-they-belong-to "用户分组") | [Go](https://github.com/openset/leetcode/tree/master/problems/group-the-people-given-the-group-size-they-belong-to) | Medium |

internal/leetcode/problems_status.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ var problemStatus = map[int]bool{
114114
443: true,
115115
445: true,
116116
448: true,
117+
453: true,
117118
455: true,
118119
459: true,
119120
461: true,

problems/minimum-moves-to-equal-array-elements/minimum_moves_to_equal_array_elements_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ func TestMinMoves(t *testing.T) {
1313
in: []int{1, 2, 3},
1414
want: 3,
1515
},
16+
{
17+
in: []int{5, 3, 1},
18+
want: 6,
19+
},
1620
}
1721
for _, tt := range tests {
1822
got := minMoves(tt.in)

0 commit comments

Comments
 (0)