There are crosses X68547


Statement
 

pdf   zip

html

Program a function hay_cruces(M) which, given an array of dimensions fil * col (for fil, col ≥ 3 ) whose elements are "-" and "*", returns True when there is at least one cross. A cross is a pattern:

-*-

***

-*-

Sample session
>>> M=[["-", "*", "-", "-"],
...    ["*", "*", "*", "*"],
...    ["-", "*", "-", "-"]]
>>> hay_cruces(M)
True
>>> M=[["-", "-", "-"],
...    ["*", "*", "*"],
...    ["-", "*", "-"],
...    ["-", "-", "-"]]
>>> hay_cruces(M)
False
Information
Author
InfBesos
Language
English
Translator
Original language
Spanish
Other languages
Catalan Spanish
Official solutions
Python
User solutions
Python