Project Euler #249: Prime Subset Sums

Sort by

recency

|

32 Discussions

|

  • + 0 comments

    I just wanna know any solution which doesn't need pre-calculated constants. I pre-calculated an array with length=7000, and compressed the continuous repeat values so that my submitted code won't exceed 50kB.

  • + 0 comments

    https://github.com/Sundesh7/Hackerrank-Solutions/blob/main/Project%20Euler%20%23249:%20Prime%20Subset%20Sumshttps://github.com/Sundesh7/Hackerrank-Solutions/blob/main/Project%20Euler%20%23249:%20Prime%20Subset%20Sums Two cases success!

  • + 0 comments

    There is no point of this problem.

  • + 1 comment

    In input 0

    2 10 4

    what is the role of 2 ?

    • + 0 comments

      2 is the size of the upcoming array. 10,4 are the elements of the array.

      for each element i in the array, do the following: 1. find the set of prime numbers from 0-i. 2. Find all the subsets from the above set, such that, the sum of those subset is again a prime number. 3. Do step 1&2 for all the numbers in the array.

  • + 1 comment

    which are less than 4? [2 3 5 5 7 7 17] -> [{2},{3},{5},{2;3},{7},{2;5},{2;3;5;7}]

    2 and 3 right? Why does the exercise say 3?

    • + 0 comments

      {2}=2, {3}=2, {2,3}=5

      1. Each set above are composed of primes less then 4.
      2. Each set above has a sum equals to a prime number.