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 6792245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:56:44+00:00 2026-05-26T17:56:44+00:00

0K, here it the problem, I’ll try to make it as clear as possible.

  • 0

0K, here it the problem, I’ll try to make it as clear as possible.

So, we have an array of key-value pairs in the form unique id => number.

pseudo code array A= array(0 => 17, 1 => 26, 2 => 17, 3 => 2, 4 => 7, 5 => 8);

we see that the total of the numbers is 60. THIS IS ALWAYS CORRECT, SO THE TOTAL IN ARRAY A IS ALWAYS CORRECT.

now we have array B
in array B, also unique id => value pairs, BUT here some of the values are PHONY/INCORRECT, and total(array B)-total(array A) has to be 0.

i.e. for the upper example array A= array(6 => 22, 7 => 11, 8 => 8, 9 => 9, 10 => 5, 11 => 10, 12 => 7, 13 => 17, 14 => 10);

now, array B total is 99. 60-99=-39, which means we have to find all of the combinations of numbers that equal 39 from array B. in this case, just looking @ eye it seems the only 2 combinations of this are possible: that unique ids 10, 12 ,13, 14 are incorrect or that 10, 11, 12, 13 are PHONY/INCORRECT (5+7+17+10=39). now, with such small arrays it is easy to find these using loops and iterating through all possible options, but with arrays ranging in the thousands (of unique IDs). what is the best way to do this? how would the computer find the phony/incorrect pairs the fastest?

Also, I owe a beer to the person that gives the best (and good) answer.

  • 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-26T17:56:44+00:00Added an answer on May 26, 2026 at 5:56 pm

    now, array B total is 99. 60-99=-39, which means we have to find all of the combinations of numbers that equal 39 from array B.

    This is only true if you know that all numbers that are wrong should have been zeros.

    Any or all numbers in the array could contribute to the error by being off by such amounts that the total of the error amounts is 39.

    That being said, the problem of finding a subset of a list of numbers that add to a particular sum is related to the Subset Sum problem, though the normal statement of the problem is only verifying the existence of such a subset, and you’re looking for a list of all such subsets.

    I don’t believe an effective solution exists for large sets, and the brute force solution grows exponentially.

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

Sidebar

Related Questions

Now here's a fun problem. I have an object array as the following: objRequests
i have a problem here, i want to make a multiple toolbar which works
Simple problem here (I think). I have a form with a checkbox at the
Maddening problem here. When my page loads: <body onload=getClientDateTime();> It runs this function: document.getElementById('ClientDateTime').value=hello
I have a problem here. My Zend_Forms do not render in view script. Via
I'm having a strange problem here... I have an ASP.NET 3.5 application that has
I'm facing a problem here, with HttpListener. When a request of the form http://user:password@example.com/
I have an interesting problem here I've been trying to solve for the last
Well the problem here is that if you have one DataTemplate for a type
I have some problem here. Here it is: I have this class public class

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.