# [Kotlin], 74 bytes {it.stream().reduce(1){r,v->if(r*25>r*v)1 else(r*if(v<30)2 else 6)%864}<1} (-1 byte thanks Lynn: replaced r>0&&v<25 with r*25>r*v) <s> {it.stream().reduce(1){r,v->if(r>0&&v<25)1 else(r*if(v<30)2 else 6)%864}<1} </s> This lambda expression takes a List<Int> and returns true for a heatwave or false else. Thanks to the magic number 864 and to [Udo Borkowski](https://codegolf.stackexchange.com/users/81057) and Mathis for their ideas. How does if work? Each sequence of numbers is iterated with a reduce operation starting at the reduce value 1. If a number >= 25 is seen the reduce is multiplied by 2. If a number >= 30 is seen the reduce is multiplied by 2 and by 3 = 6. If a number < 25 is seen the reduce starts again at 1. If the reduce is divisible by 864=2*2*2*2*2*3*3*3 then a heatwave is found, and the result of the modulo operation is 0 which results in a reduce value of 0 and in a return value of true. [Try it online!][TIO-jie5h5ls] [Kotlin]: https://kotlinlang.org [TIO-jie5h5ls]: https://tio.run/##nVZta9swEP7eXyHKBnZJi978kpAFtg@DwWAf2j9gNqcxc5xiu4ES8tszWb6TzhmV2QzCsnT33KN7s34f@rpqLseiZrsVi75XXb/@1vSbmN1v2JfDoS6Lhn1il1PVP3R9Wxb7KH5oy1@vP8tIxKd2cbzfVNuovZPJpr07xoKVdVeab7N4XCseS7vA0vhjnurzWpwvzDzb14bti6qJiva5W7HPbVu8rR/7tmqejenTDYNn4LUtDMDbY7F/qcvOcKkNxx/byMngA@vG5uK9PblcMBw6W7CQrBJeVuZmaDMUWUvNGDCGNQ7f6TgPcjDyDjsdZAEbcZMR164NdiVg6nGu5LinVNiG1U@Amwb9HPQlrgcw0L4YdRXiaTgznNvipVf8OTmXGjFkFrCVAr4Y8exAbEH2NPhOgY8GPTkTb/CblZfAD@OnYXDiK@Q9F0Pl4xGMN/jQyoKOi3sOPDAnJLwxBzKY5wH8bNTXEvwiZ@RpfJbg4wT0hOdhsRLCCb7H2McOPr6ZVGvfvva7f6lWYAFvLd5nbkiAbxSfvkNDc6smwpXuMpz7SrEDMs3KKNhb@iqgGWrZYGVTr6Ugt/TVO1cNiIE4FisjFYwZmEy5WQ5g03IhFa/wbCnpWtlMJ@Fgm/sKd7bUTJUkYAt8qwkfx0V5PpY77ilSmZDheDaMk@tAeJZA1qMtGmuXexgzQfzJr7q/8Gd3XTB0dhp/Gg9JukxOunxC4oz@wJhDfQTtpb77us6Z@7@S85Ege7nPd6XDvlOK/LE0YEAHloEOrDjxA/o1u8qBpe88bgC@4t53KOtyg/AI/gWga9HYWR3tY@98PelsOHsxF5O@bqLbr/Yusrr1W9tDy6LOtjtWNdPLCr3JTGDYh9MOlOIzI2jnv00@2YYaMDnpuP9j0k7Plz8 "Kotlin – Try It Online"