How to find the split in the given set of numbers.

23 Views Asked by At

Beforehand I would like to express apologies if this sort of question is not suited here, but I desperately need it answered.

I have a set of numbers:

[2, 5, 6, 2, 2, 81, 72, 77]

From the above set, we can say that certain numbers above can be "grouped" together. Such that:

[2, 5, 6, 2, 2]

and

[81, 72, 77]

My question is how do I obtain the above two groupings? Is there an algorithm or formulae to achieve this?

1

There are 1 best solutions below

0
On

Figured it out. As mentioned in the comments below my question, many people were recommending the K-Means algorithm. It worked perfectly!