/**
 * This function takes in two lists as input and returns a list containing the indices at which the elements of the input lists appear in both lists.
 *
 * @param aList A list of elements
 * @param bList Another list of elements
 * @return A list of indices at which the elements appear in both lists
 *
 * Example:
 * getCommonIndices(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => [2, 3]
 */
fun getCommonIndices(aList: List<Int>, bList: List<Int>): List<Int> {

    val commonIndices = mutableListOf<Int>()

    for (i in aList.indices) {
        if (aList[i] in bList && i in bList) {
            commonIndices.add(i)
        }
    }

    return commonIndices
}
/**
 * This function takes in two lists as input and returns a list containing the indices at which the elements of the input lists appear in both lists.
 *
 * @param aList A list of elements
 * @param bList Another list of elements
 * @return A list of indices at which the elements appear in both lists
 *
 * Example:
 * getCommonIndices(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => [2, 3]
 */
fun getCommonIndices(aList: List<Int>, bList: List<Int>): List<Int> {
/**
 * This function takes in two lists as input and returns a list containing the indices at which the elements of the input lists appear in both lists.
 *
 * @param aList A list of elements
 * @param bList Another list of elements
 * @return A list of indices at which the elements appear in both lists
 *
 * Example:
 * getCommonIndices(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => [2, 3]
 */
fun getCommonIndices(aList: List<Int>, bList: List<Int>): List<Int> {

    val commonIndices = mutableListOf<Int>()

    for (i in aList.indices) {
        if (aList[i] in bList && i in bList) {
            commonIndices.add(i)
        }
    }

    return commonIndices
}