Addition solutions:
2 digit by 2 digit solution:
To find the optimal answer for these problems, you first have to analyze the largest place currently available. For example, if you are doing the 'closest to 100' challenge, the priority lands on the tens place first. Depending on the numbers you get, the formula will adapt. Here are the 2 most effective solutions for this problem:
1). Since you are adding 2 numbers together to reach closer to 100, the 2 numbers in the tens place could not drastically be stretched far apart. The 2 numbers has to reach 10 as close as possible. For example, if you have the numbers 4, 6, 7, and 8. So far, only the numbers (4 and 6) make sense, because while added up gives a total of 10. Any other combination is not as close, which rather falls under or goes over.
You can compare it like this:
4+6 = 10
7 + 8 = 15
6 + 8 = 14
Overall, the first option is closest to 10. The rest of the numbers could be placed in the remaining areas. Finally, the rest of the numbers has to be checked. If the outcome for the ones ends up higher than 5, its better for the tens number to add up to a 9. Since in this instance, a 96 is closer to 100 than a 106.
2). This is the second condition for this problem. Sometimes the closest number to 10 is not the best solution. For example, the numbers 8, 9, 1, 2. Usually, the first formula would work really well. But in this case, it is not the most optimal. If you adapt to the earlier method, 8+2=10, and 9+1=10. Both of these work right? But actually, this trick leaves another flaw. Lets say the 8 and the 2 go into the tens place, giving remainder to the 1 and 9.
81
+29
------
110
Looking at this, not only does the 8 and 2 make 100, the 9 and 1 makes a 10. This gives 110.
If you ever come across a problem where the ones place adds up to become a double digit number, you have to adapt. Now the new rule is how close you can get the number to 9. This leaves enough space for the ones to carry into the tens, allowing for it to be closer to 100.
8+1=9, which leaves 2 and 9 behind. After adding them up, it will become 101. because 2+9=11, the extra ten carries into the 90(from 80+10), which creates a full 100. Another special occasion is when the ones don't add up to a full 10, but is within range of it. For example, it could add up to 8 or 9. This is most likely the correct answer for the problem to use a 90+ a number close to 10.
3) The third and final condition is the ones place numbers. If you end up receiving high numbers like 9 and 8, added together would give you a 17, where rounded up is around a 20. This is a special case, where you try to drop it to a closer 8. For example, the numbers 1, 7, 8, 9. Right now there are 3 large numbers, and when added together would guarantee a rounding towards 20. In this instance, don't add the closest number to 10(like 9 and 1), but because 3 of our numbers if paired in any way gives a rounding for 20, go for an 8 combination, like 7 and 1.
-------------------------------------------------------------------------------