GoLang Solution For LeetCode Problem: Distant Barcodes
Solving Distant Barcodes in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.
Rearrange the barcodes so that no two adjacent barcodes are equal. You may return any answer, and it is guaranteed an answer exists.
Input: [1,1,1,2,2,2] Output: [2,1,2,1,2,1]
Input: [1,1,1,1,2,2,3,3] Output: [1,3,1,3,2,1,2,1]
1 <= barcodes.length <= 10000
1 <= barcodes[i] <= 10000
See the full details of the problem Distant Barcodes at LeetCode
Originally posted at: @github.com/halfrost/LeetCode-Go