Timeline for How to loop an array and sum values until condition is met?
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 23, 2021 at 14:33 | comment | added | user234725 | Nicely done. I knew you were up for the challenge. :-) | |
Sep 23, 2021 at 7:04 | history | edited | Erwin Brandstetter | CC BY-SA 4.0 |
only biggest amount for failed case
|
Sep 23, 2021 at 7:03 | comment | added | Erwin Brandstetter | @dwhitemv: True. I adapted accordingly. In my defense: neither pseudocode nor test data nor desired result are clear about that. And the largest account value is ambiguous. Add a couple of amount 50 and remove the 300 from Tester, and you need a tiebreaker or an arbitrary pick ... | |
Sep 23, 2021 at 5:48 | comment | added | user234725 | Nitpick: The specification states, "If the threshold is not met there should be some output that specifies the criteria was not met and the largest account value should be returned." Your query returns all the accounts for companies that don't meet the threshold. Add a couple of amount 50 accounts to Tester to see. | |
Sep 23, 2021 at 5:10 | history | answered | Erwin Brandstetter | CC BY-SA 4.0 |