B
B
blackCover2021-04-06 20:59:06
Dart
blackCover, 2021-04-06 20:59:06

How to decompose a sheet of 5 numbers into sheets of 3 unique numbers in Dart?

Good day. Beginner programmer, starting to learn Dart.
I found a problem: there is a sheet of 5 numbers ls = [51, 56, 58, 59, 61], it is necessary to decompose into combinations of 3 unique numbers and check that their sum is less than some number.
On paper, I painted like this: [51,56,58], [51,56,59], [51,56,61], [51,58,59], [51, 58,61], [51, 59.61], [56.58.59], [56.58.61], [56.59.61], [58.59.61].
Can you tell me how to describe it in code? Maybe it's simple, but I don't know the language yet and I ask you to help the salaga))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Neonoviiwolf, 2021-04-07
@Neonoviiwolf

Here the language is not important, combinatorics will help you.
And so https://pub.dev/packages/trotter - it seems to do what you need, open the code and see the implementation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question