/**
 * This function returns the element in set1 at the specified index.
 *
 * @param set1 The set containing elements.
 * @param index The index of the element to be retrieved.
 * @return The element at the specified index in set1, or null if the index is out of range or set1 is empty.
 */
fun getElementAtIndex(set1: Set<Any>, index: Int): Any? {

    if (set1.isEmpty() || index < 0 || index >= set1.size) {
        return null  // Return null if set1 is empty or index is out of range
    }
    
    return set1.elementAt(index)
}
/**
 * This function returns the element in set1 at the specified index.
 *
 * @param set1 The set containing elements.
 * @param index The index of the element to be retrieved.
 * @return The element at the specified index in set1, or null if the index is out of range or set1 is empty.
 */
fun getElementAtIndex(set1: Set<Any>, index: Int): Any? {
/**
 * This function returns the element in set1 at the specified index.
 *
 * @param set1 The set containing elements.
 * @param index The index of the element to be retrieved.
 * @return The element at the specified index in set1, or null if the index is out of range or set1 is empty.
 */
fun getElementAtIndex(set1: Set<Any>, index: Int): Any? {

    if (set1.isEmpty() || index < 0 || index >= set1.size) {
        return null  // Return null if set1 is empty or index is out of range
    }
    
    return set1.elementAt(index)
}