Hi I have a List<decimal>
containing values between ]0;1].
I want to check if a total (or subtotal) of these values can equal 1 (or almost).
I can also use Linq
functions to filter or manipulate the list.
Desired results:
- A list containing {0.7, 0.7, 0.7} should return false;
- A list containing {0.7, 0.3, 0.7} should return true;
- A list containing {0.777777, 0.2, 0.1} should return false;
- A list containing {0.33333, 0.33333, 0.33333} should return true;
- A list containing {0.4, 0.5, 0.6, 0.3} should return true.
Obviously, I'll want something with the lowest performance cost possible.