Skip to main content
added 32 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

Japt, 1112 bytes

Outputs an empty array if no solution is possible.

à5Íà5 â fÈx ¶V

Try itTry it

à5Íà5 â fÈx ¶V     :Implicit input of array U & target integer V
à5Í              :Combinations of :Sort U 
 à5              :Combinations of length 5
    â            :Deduplicate
      f          :Filter by
       È         :Passing through the following function
        x        :  Reduce by addition
          ¶V     :  Equal to V?

Japt, 11 bytes

Outputs an empty array if no solution is possible.

à5 â fÈx ¶V

Try it

à5 â fÈx ¶V     :Implicit input of array U & target integer V
à5              :Combinations of U of length 5
   â            :Deduplicate
     f          :Filter by
      È         :Passing through the following function
       x        :  Reduce by addition
         ¶V     :  Equal to V?

Japt, 12 bytes

Outputs an empty array if no solution is possible.

Íà5 â fÈx ¶V

Try it

Íà5 â fÈx ¶V     :Implicit input of array U & target integer V
Í                :Sort U 
 à5              :Combinations of length 5
    â            :Deduplicate
      f          :Filter by
       È         :Passing through the following function
        x        :  Reduce by addition
          ¶V     :  Equal to V?
added 381 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

Japt, 11 bytes

Outputs an empty array if no solution is possible.

à5 â fÈx ¶V

Try it

à5 â fÈx ¶V     :Implicit input of array U & target integer V
à5              :Combinations of U of length 5
   â            :Deduplicate
     f          :Filter by
      È         :Passing through the following function
       x        :  Reduce by addition
         ¶V     :  Equal to V?

Japt, 11 bytes

à5 â fÈx ¶V

Try it

Japt, 11 bytes

Outputs an empty array if no solution is possible.

à5 â fÈx ¶V

Try it

à5 â fÈx ¶V     :Implicit input of array U & target integer V
à5              :Combinations of U of length 5
   â            :Deduplicate
     f          :Filter by
      È         :Passing through the following function
       x        :  Reduce by addition
         ¶V     :  Equal to V?
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

Japt, 11 bytes

à5 â fÈx ¶V

Try it