Generate all possible Subsets of given string
Sun Feb 06 2022 21:45:23 GMT+0000 (Coordinated Universal Time)
Saved by @Uttam #java #gfg #geeksforgeeks #lecture #recursion #generate subsets
NOTE : All Characters in the input string are distinct. For a string of length n, there are going to be 2^n subsets. Examples: Input : set = "ab" Output : "", "a", "b", "ab" Input : set = "abc" Output : "", "a", "b", "c", "ab", "ac", "bc", "abc" Input : set = "abcd" Output : "" "a" "ab" "abc" "abcd" "abd" "ac" "acd" "ad" "b" "bc" "bcd" "bd" "c" "cd" "d"
Comments