/**
 * Given a list of integers 'nums' and a dancer, delete all the elements in 'nums'
 * that are divisible by the dancer's position. Return the modified list 'nums'.
 *
 * @param dancer The position of the dancer.
 * @param nums A list of integers.
 * @return The modified list 'nums' after deleting elements divisible by dancer's position.
 */
fun deleteElements(dancer: Int, nums: MutableList<Int>): MutableList<Int> {

    var i = 0
    while (i < nums.size) {
        if (nums[i] % dancer == 0) {
            nums.removeAt(i)
        } else {
            i++
        }
    }
    return nums
}
/**
 * Given a list of integers 'nums' and a dancer, delete all the elements in 'nums'
 * that are divisible by the dancer's position. Return the modified list 'nums'.
 *
 * @param dancer The position of the dancer.
 * @param nums A list of integers.
 * @return The modified list 'nums' after deleting elements divisible by dancer's position.
 */
fun deleteElements(dancer: Int, nums: MutableList<Int>): MutableList<Int> {
/**
 * Given a list of integers 'nums' and a dancer, delete all the elements in 'nums'
 * that are divisible by the dancer's position. Return the modified list 'nums'.
 *
 * @param dancer The position of the dancer.
 * @param nums A list of integers.
 * @return The modified list 'nums' after deleting elements divisible by dancer's position.
 */
fun deleteElements(dancer: Int, nums: MutableList<Int>): MutableList<Int> {

    var i = 0
    while (i < nums.size) {
        if (nums[i] % dancer == 0) {
            nums.removeAt(i)
        } else {
            i++
        }
    }
    return nums
}