1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| fun twoPointers(nums1: IntArray, nums2: IntArray) { var pointer1 = 0 var pointer2 = 0
while (pointer1 < nums1.size && pointer2 < nums2.size) {
pointer1++ pointer2++ }
while (pointer1 < nums1.size) { pointer1++ }
while (pointer2 < nums2.size) { pointer2++ } }
|