Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6390539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:33:35+00:00 2026-05-25T03:33:35+00:00

The title is probably a little ambiguous. There is a given number. There is

  • 0

The title is probably a little ambiguous.

There is a given number.

There is a set of numbers all less than the given number and greater than zero.

I want to know how many different combinations of adding numbers there are that equal the given number.

For example if the given number is 14 and the numbers in the set are 7, 7, 7, 6, 4, and 4.
There would be 4 combinations. (7+7, 7+7, 7+7, 6+4+4)

I don’t really care what language the solution is in, but I would prefer C++ or Python.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:33:35+00:00Added an answer on May 25, 2026 at 3:33 am

    Don’t be discouraged by the claims that this is NP-complete. The Wikipedia article on Subset Sum linked by @isbadawi mentions a 1999 paper by Professor David Pisinger with an algorithm that sounds like it would work with your existing constraints in linear time: http://www.sciencedirect.com/science/article/pii/S0196677499910349 . It’s $31.50, but that sounds like a bargain if you really need to solve this problem well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Title pretty much sums it up. Is there a technical name given to a
Title more or less says it all. In response to a touchesBegan event, my
Probably very simple question (I just want to ensure I'm right). Title is not
I realise there have probably been a few questions with a title similar to
Sorry, that title probably doesn't make much sense, but what I want to know
Title probably doesn't make a lot of sense, so I'll start with some code:
I probably couldn't depict it better in the title (and if it has a
As you can probably tell by the title, I'm not sure the best way
Title said it all. Some context: I got a search mechanism - search view,
Title pretty much says it all. The web.config, unchanged from how VS2008SP1 generated it,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.