Problem: The current implementation of allSubsets uses combinations and might not be efficient for larger sets due to its reliance on array copying and collection operations.
Suggestion: Implement a more efficient algorithm (e.g., using a bitmask or recursive approach) to generate subsets, reducing memory usage and improving runtime.