/**
 * Given a list of elements, return a new list containing the elements at the specified indices.
 *
 * @param elements a list of elements
 * @param indices a list of indices indicating the positions of the elements to be extracted
 * @return a list containing the elements at the specified indices
 */
fun accessingElementsInList(elements: List<String>, indices: List<Int>): List<String> {

    val extractedElements = mutableListOf<String>()
    for (index in indices) {
        if (index < elements.size) {
            extractedElements.add(elements[index])
        }
    }
    return extractedElements
}
/**
 * Given a list of elements, return a new list containing the elements at the specified indices.
 *
 * @param elements a list of elements
 * @param indices a list of indices indicating the positions of the elements to be extracted
 * @return a list containing the elements at the specified indices
 */
fun accessingElementsInList(elements: List<String>, indices: List<Int>): List<String> {
/**
 * Given a list of elements, return a new list containing the elements at the specified indices.
 *
 * @param elements a list of elements
 * @param indices a list of indices indicating the positions of the elements to be extracted
 * @return a list containing the elements at the specified indices
 */
fun accessingElementsInList(elements: List<String>, indices: List<Int>): List<String> {

    val extractedElements = mutableListOf<String>()
    for (index in indices) {
        if (index < elements.size) {
            extractedElements.add(elements[index])
        }
    }
    return extractedElements
}