/**
 * This exercise demonstrates the usage of unconditioned ternary operator 
 * along with indexing.
 *
 * Given an input list and an index, complete the function to return the 
 * value at the given index if it exists in the list; otherwise, return null.
 *
 * @param inputList A list of elements.
 * @param index An integer representing the index to be checked.
 * @return Value at index if it exists in the list, else null.
 */
fun ternaryOperatorIndexing(inputList: List<Any>, index: Int): Any? {

    // Use unconditioned ternary operator along with indexing to return the value
    return if (index in 0 until inputList.size) inputList[index] else null
}
/**
 * This exercise demonstrates the usage of unconditioned ternary operator 
 * along with indexing.
 *
 * Given an input list and an index, complete the function to return the 
 * value at the given index if it exists in the list; otherwise, return null.
 *
 * @param inputList A list of elements.
 * @param index An integer representing the index to be checked.
 * @return Value at index if it exists in the list, else null.
 */
fun ternaryOperatorIndexing(inputList: List<Any>, index: Int): Any? {
/**
 * This exercise demonstrates the usage of unconditioned ternary operator 
 * along with indexing.
 *
 * Given an input list and an index, complete the function to return the 
 * value at the given index if it exists in the list; otherwise, return null.
 *
 * @param inputList A list of elements.
 * @param index An integer representing the index to be checked.
 * @return Value at index if it exists in the list, else null.
 */
fun ternaryOperatorIndexing(inputList: List<Any>, index: Int): Any? {

    // Use unconditioned ternary operator along with indexing to return the value
    return if (index in 0 until inputList.size) inputList[index] else null
}