Powerset of a list using abstract list functions
问题 Is it possible to make a racket function to return powerset of a given list ? Constraints- without explicit recursion use abstract list functions code contained in 2 lines (actual requirement) For eg: (powerset '(1 2)) '((1 2) (1) (2) ()) in any order. The other question I found still uses explicit recursion. My workflow: Taking (powerset '(a b c)) as an example, First get a list of whole numbers up to (expt 2 (length list)) ;'(0 1 2 3 4 5 6 7) Convert them into their respective binary form 2