``` if (!existCell.isEmpty()) { cell = when(exis...
# codereview
s
Copy code
if (!existCell.isEmpty()) {
  cell = when(existCell[existCell.size - 1]) {
    1 -> 9
    3 -> 7
    7 -> 3
    9 -> 1
    else -> 0  // or some default value
  }
}
👍 1
e
if (!existCell.isEmpty()) { val cellValue = existCell[existCell.size - 1] if ( cellValue%2==0 || cellValue==5) cell = 0 else cell 10- cellValue }