a categorical model of this problem


  • 0
    L

    a permutation is a homomorphism on list algebra

    {[],cons} => {[[]], flatten. insert*}
    

    where insert x L = [ ll++[x]++lr | (ll,lr) <- breaks(L)], and f* = map f


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.