#K91337. Valid Digital Lock System
Valid Digital Lock System
Valid Digital Lock System
You are given a string representing a digital lock system. The string consists of characters '#' and '.'. The system is considered valid if it does not contain two consecutive period characters.
In other words, a string s is valid if and only if there does not exist an index \(i\) such that \(s_i = '.'\) and \(s_{i+1} = '.'\). For example, the string "##.#.#.#" is valid, whereas "##..##" is invalid.
Note that an empty string is also considered valid.
inputFormat
The input is provided via standard input (stdin) as a single line containing the lock system string, which may consist of characters '#' and '.'.
outputFormat
The output should be printed to standard output (stdout) as a single line containing either True
if the lock system is valid, or False
otherwise.
##.#.#.#
True