title: Kotlin reduce how to apply operation on more than one element
body: <p>I have a list of numbers. I want to have the following operation: <code>1*2 + 3*4</code>. However, the reduce operation works only with one element at a time. And in my case I need to work with two elements at a time. Is it possible to do this with <code>reduce</code>, or with any other method?</p>
  
  <pre><code>package com.zetcode
  
  fun main(args: Array&lt;String&gt;) {
  
      val nums = listOf(1, 2, 3, 4)
  
      val res = nums.reduce { total, next -&gt; total * next }
      println(res)
  }
  </code></pre>