With scala.collection.mutable.ArrayBuffer, we can remove an element at an index using remove(index).
val arr = scala.collection.mutable.ArrayBuffer(1, 4, 6)
arr.remove(1)
// arr is now ArrayBuffer(1, 6)
Assignment
Follow the Coding Tutorial and remove an item.
Hint
Use remove(index).
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check