One thought on “Generate all unique substrings for given string

  1. Dionysios January 13, 2014 / 12:22 am

    Another way: Generate all binary combinations first (including the empty set):

    bc: {$[0 >= x;:enlist(); 1 = x; :(0b; 1b); [r: bc x – 1; :((0b,’r),(1b,’r))]]}
    s: {x[where each bc count x]}

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.