subsets for [4,4,4,1,4]


  • 0
    T

    Input:
    [4,4,4,1,4]
    Output:
    [[],[4],[1],[1,4],[4,4],[4,1],[4,1,4],[4,4,4],[4,4,1],[4,4,1,4],[4,4,4,4],[4,4,4,1],[4,4,4,1,4]]
    Expected:
    [[],[1],[1,4],[1,4,4],[1,4,4,4],[1,4,4,4,4],[4],[4,4],[4,4,4],[4,4,4,4]]

    How come [1,4,4,4] a subset for [4,4,4,1,4]??


  • 0
    A

    [4,4,4,1,4] Input refers to the below subset

    Expected:
    [[],[1],[1,4],[1,4,4],[1,4,4,4],[1,4,4,4,4],[4],[4,4],[4,4,4],[4,4,4,4]]


  • 0
    T
    This post is deleted!

  • 0
    T

    @abhishek27155 Yea, my previous understanding for subsets is wrong. So get [[],[4],[1],[1,4],[4,4],[4,1],[4,1,4],[4,4,4],[4,4,1],[4,4,1,4],[4,4,4,4],[4,4,4,1],[4,4,4,1,4]]. Thanks for reply:)


Log in to reply
 

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