Hay cruces X68547


Statement
 

pdf   zip

html

Programa una función hay_cruces(M) que, dada una matriz de dimensiones fil*col (para fil,col ≥ 3) cuyos elementos son "-" y "*", devuelva True cuando haya al menos una cruz. Una cruz es un patrón:

-*-

***

-*-

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