scala twoliner
scala\nobject Solution {\n  def minSum(nums1: Array[Int], nums2: Array[Int]): Long =\n    val x2918_0 = List(nums1, nums2).map{a =>\n      a.foldLeft(List(0L,0L
```scala\nobject Solution {\n  def minSum(nums1: Array[Int], nums2: Array[Int]): Long =\n    val x2918_0 = List(nums1, nums2).map{a =>\n      a.foldLeft(List(0L,0L)){case (l,n) =>\n        if(n==0) List(l.head,l.last+1) else List(l.head+n,l.last)\n    }}.sortBy(_.sum)\n    if(x2918_0.head.last==0 && x2918_0.head.sum < x2918_0.last.sum) -1\n    else x2918_0.last.sum\n}\n```
['Scala']