def lcm(l):
l = [int(i) for i in l if isinstance(i, (int, float)) or str(i).isdigit()]
if not l:
return 0
n = 1
while 1:
if all(n % j == 0 for j in l):
return n
n += 1
[error] -- Error: /github/Vyxal/shared/src/vyxal/ListHelpers.scala:658:8 ---
[error] 658 | for (i, j) <- makeIterable(lst).zip(makeIterable(part)) do
[error] | ^
[error] |this case is unreachable since type vyxal.VAny and class Tuple2 are unrelated
Code:
def partitionAfterTruthyIndices(lst: VAny, part: VAny)(using Context): VList =
var res = ArrayBuffer(VList())
for (i, j) <- makeIterable(lst).zip(makeIterable(part)) do
res(res.length - 1) = VList.from(res(res.length - 1) :+ i.asInstanceOf[VAny])
if j.asInstanceOf[VAny].toBool then res = res :+ VList()
VList.from(res.toList)
[error] 658 | for (i, j) <- makeIterable(lst).vzip(makeIterable(part)) do
[error] | ^
[error] |this case is unreachable since type vyxal.VAny and class Tuple2 are unrelated