/**
 * Given a list of numbers [nums] and a list of indices [indices], return a list containing only the numbers
 * from [nums] that are located at the specified indices.
 *
 * @param nums a list of numbers
 * @param indices a list of integers representing the indices
 * @return A list of numbers containing only the elements from [nums] at the specified indices
 *
 * Example:
 * booleanIndexing(listOf(3, 7, 9, 2, 5), listOf(0, 2, 4))
 * Output: [3, 9, 5]
 */
fun booleanIndexing(nums: List<Int>, indices: List<Int>): List<Int> {

    return indices.map { nums[it] }
}
/**
 * Given a list of numbers [nums] and a list of indices [indices], return a list containing only the numbers
 * from [nums] that are located at the specified indices.
 *
 * @param nums a list of numbers
 * @param indices a list of integers representing the indices
 * @return A list of numbers containing only the elements from [nums] at the specified indices
 *
 * Example:
 * booleanIndexing(listOf(3, 7, 9, 2, 5), listOf(0, 2, 4))
 * Output: [3, 9, 5]
 */
fun booleanIndexing(nums: List<Int>, indices: List<Int>): List<Int> {
/**
 * Given a list of numbers [nums] and a list of indices [indices], return a list containing only the numbers
 * from [nums] that are located at the specified indices.
 *
 * @param nums a list of numbers
 * @param indices a list of integers representing the indices
 * @return A list of numbers containing only the elements from [nums] at the specified indices
 *
 * Example:
 * booleanIndexing(listOf(3, 7, 9, 2, 5), listOf(0, 2, 4))
 * Output: [3, 9, 5]
 */
fun booleanIndexing(nums: List<Int>, indices: List<Int>): List<Int> {

    return indices.map { nums[it] }
}