unordered_set to vector

#include <iostream>
#include <unordered_set>
#include <vector>

int main() {
    // Step 1: Create an unordered_set
    std::unordered_set<int> unorderedSet = {1, 2, 3, 4, 5};

    // Step 2: Create a vector and initialize it using the range constructor
    std::vector<int> vectorFromSet(unorderedSet.begin(), unorderedSet.end());

    // Step 3: Print the elements of the original unordered_set
    std::cout << "Original unordered_set elements: ";
    for (const auto &element : unorderedSet) {
        std::cout << element << " ";
    }
    std::cout << std::endl;

    // Step 4: Print the elements of the vector created from the unordered_set
    std::cout << "Vector elements from unordered_set: ";
    for (const auto &element : vectorFromSet) {
        std::cout << element << " ";
    }
    std::cout << std::endl;

    return 0;
}