Enigma - The Cipher Machine
Anonymous User
1318

The modified version of enigma machine developed to protect communication in 20th century.
Given rotorCount. Each router can be set between min_Value to max_Value the ranges are inclusive. The valid combinations have 1th through rotoCount(th) are coprime with respect 0(th) position value.

Count all possible sets

For example:
rotoCount = 3
min_Value = 2
max_value = 4
possible Combinations are {(3,2,2), (3,2,4) ,(3,4,4),(3,4,2),(2,3,3),(4,3,3)}
output = 6
Invalid Combinations are(2,4,3),(2,3,2),(2,2,2)....

Comments (6)