A
A
angelzzz2016-04-18 14:58:00
Algorithms
angelzzz, 2016-04-18 14:58:00

How to form character sets that meet the requirements?

There are 30 characters (26 characters of the Latin alphabet and numbers 1,2,3,4). It is necessary to form 30 sets of 6 characters each, satisfying the requirements:
1. all characters are randomly distributed
2. in one set of 6 characters, all characters are unique (that is, they do not repeat)
3. for each set of 6 characters, there is another set that has only 1 character matches
How can this be done via js?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MiiNiPaa, 2016-04-18
@MiiNiPaa

  1. Randomly choose 6 characters without repetitions from the main character set
  2. Create an additional set consisting of the characters of the main minus 6 characters of the current set
  3. Create a new set containing a random character from the current set
  4. Declaring the new set current and adding 5 random non-repetitive characters from the additional set
  5. goto 2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question