You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 324. Wiggle Sort II.go
    path of file: ./repos/LeetCode-Go/leetcode/0324.Wiggle-Sort-II
    
    the code of the file until where you have to start completion: package leetcode

import (
	"sort"
)

// 解法一
func wiggleSort(nums []int) {
	if len(nums) < 2 {
		return
	}
	median := findKthLargest324(nums, (len(nums)+1)/2)
	n, i, left, right := len(nums), 0, 0, len(nums)-1

	for i <= right {
		if nums[indexMap(i, n)] > median {
			nums[indexMap(left, n)], nums[indexMap(i, n)] = nums[indexMap(i, n
    
func wiggleSort(nums []int) {
	if len(nums) < 2 {
		return
	}
	median := findKthLargest324(nums, (len(nums)+1)/2)
	n, i, left, right := len(nums), 0, 0, len(nums)-1

	for i <= right {
		if nums[indexMap(i, n)] > median {
			nums[indexMap(left, n)], nums[indexMap(i, n)] = nums[indexMap(i, n)], nums[indexMap(left, n)]
			left++
			i++
		} else if nums[indexMap(i, n)] < median {
			nums[indexMap(right, n)], nums[indexMap(i, n)] = nums[indexMap(i, n)], nums[indexMap(right, n)]
			right--
		} else {
			i++
		}
	}
}