• Skip to primary navigation
  • Skip to content
  • Skip to footer
Umut Özge Graduate School of Informatics, METU
  • Posts
  • Categories
  • Tags

    Solution: Power set

    def pset(seq):
        if not seq:
            return [[]]
        else:
            rest = pset(seq[1:])
            return [[seq[0]] + x for x in rest] + rest
    

    Download .ipynb Download .py
    © 2026 Umut Özge. Powered by Jekyll & Minimal Mistakes.