/**
 * This exercise requires you to find the indices of elements in a list that are both
 * members of the given data and equal to the target value. You need to return a list
 * of all such indices.
 *
 * @param data A list of elements.
 * @param target The value to compare against.
 * @return List of indices where elements are both members of data and equal to the target value.
 */
fun membershipAndEqual(data: List<Int>, target: Int): List<Int> {

    val indices = mutableListOf<Int>()
    for (i in data.indices) {
        if (data[i] == target) {
            indices.add(i)
        }
    }
    return indices
}
/**
 * This exercise requires you to find the indices of elements in a list that are both
 * members of the given data and equal to the target value. You need to return a list
 * of all such indices.
 *
 * @param data A list of elements.
 * @param target The value to compare against.
 * @return List of indices where elements are both members of data and equal to the target value.
 */
fun membershipAndEqual(data: List<Int>, target: Int): List<Int> {
/**
 * This exercise requires you to find the indices of elements in a list that are both
 * members of the given data and equal to the target value. You need to return a list
 * of all such indices.
 *
 * @param data A list of elements.
 * @param target The value to compare against.
 * @return List of indices where elements are both members of data and equal to the target value.
 */
fun membershipAndEqual(data: List<Int>, target: Int): List<Int> {

    val indices = mutableListOf<Int>()
    for (i in data.indices) {
        if (data[i] == target) {
            indices.add(i)
        }
    }
    return indices
}