Lock pattern checker X65639


Statement
 

pdf   zip

html

Input

The input will be a single line containing a sequence of numbers ranging from 1 to 9 (one per each circle) separated by minus sign.

Output

The output will be a single line stating whether the pattern is ok, otherwise print the first pair of circles that cannot be connected in the pattern.

Public test cases
  • Input

    1-5-8-9
    

    Output

    Pattern is ok
    
  • Input

    1-9-8-5
    

    Output

    Circle 1 can not connect with circle 9
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    Python
    User solutions
    C++ Java Python