这是题目的网址,感兴趣可以去试试 : 原题网址
题目 :
Given two arrays of length m and n with digits 0-9 representing two
numbers. Create the maximum number of length k <= m + n from digits of
the two. The relative order of the digits from the same array must be
preserved. Return an array of the k digits. You should try to optimize
your time and space complexity.Example 1: nums1 = [3, 4, 6, 5] nums2 = [9, 1, 2, 5, 8, 3] k = 5
return [9, 8, 6, 5, 3]Example 2: nums1 = [6, 7] nums2 = [6, 0, 4] k = 5 return [6, 7, 6, 0,
4]Example 3: nums1 = [3, 9] nums2 = [8, 9] k = 3 return [9, 8, 9]
网上我搜索了很久都没有搜索到C语言的答案,自己写了一个答案但是没用过不了,我和这个人碰到了一样的问题,这里是这个人问题的链接。。想问问是我理解题目有问题还是怎么,难道它不是要我返回一个指针吗?
据我观察你的链接里那位哥们没有给参数 returnsize赋值,所以调用端并不知道它的int数组长度,你可以检查下你的代码是否是同样的问题。