Switch for merge array in Go
This also works in VSCode and Go playground. I don't know also. Maybe I need to refer another codes. package main import "fmt" func main() { nums1 := []int{1, 2, 3, 0, 0, 0} nums2 := []int{2, 5, 6} merge(nums1, len(nums1), nums2, len(nums2)) fmt.Println(nums1) } func merge(nums1 []int, m int, nums2 []int, n int) { temp := make([]int, 0) if m > n { i := 0 j := 0 for i < m { if j == n { break ..
Go/Leet Code
2022. 2. 24. 02:19