Skip to main content
added 254 characters in body
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161

05AB1E, 67 bytes

ʒKæOyå
ʒKæ¦Oyå

Try it online! or Try all cases!Try it online!

ʒ       # keep numbers of the input where:
 K      # the input with the number removed
  æ     # all subsets of this
   O¦    # remove the first subset (the empty list)
    O   # the sums of the subsets
      # contain the current number

05AB1E, 6 bytes

ʒKæOyå

Try it online! or Try all cases!

ʒ       # keep numbers of the input where:
 K      # the input with the number removed
  æ     # all subsets of this
   O    # the sums of the subsets
      # contain the current number

05AB1E, 7 bytes

ʒKæ¦Oyå

Try it online!

ʒ       # keep numbers of the input where:
 K      # the input with the number removed
  æ     # all subsets of this
   ¦    # remove the first subset (the empty list)
    O   # the sums of the subsets
      # contain the current number
Post Undeleted by ovs
added 215 characters in body
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161

05AB1E, 86 bytes

æʒg2@}OÃʒKæOyå

Try it online!Try it online! or Try all cases!

æ ʒ       # push thekeep powersetnumbers of the input where:
 ʒK   }   # keep the subsetsinput where:
with the g2@number removed
  æ #   the length# isall <=subsets 2
of this
   O  O  # sumthe eachsums subset
of the subsets
     Ã # set intersection withcontain the inputcurrent listnumber

05AB1E, 8 bytes

æʒg2@}OÃ

Try it online!

æ        # push the powerset of the input
 ʒ   }   # keep the subsets where:
  g2@    #   the length is <= 2
      O  # sum each subset
       Ã # set intersection with the input list

05AB1E, 6 bytes

ʒKæOyå

Try it online! or Try all cases!

ʒ       # keep numbers of the input where:
 K      # the input with the number removed
  æ     # all subsets of this
   O    # the sums of the subsets
      # contain the current number
Post Deleted by ovs
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161

05AB1E, 8 bytes

æʒg2@}OÃ

Try it online!

æ        # push the powerset of the input
 ʒ   }   # keep the subsets where:
  g2@    #   the length is <= 2
      O  # sum each subset
       Ã # set intersection with the input list