| Find a correct layout of N dominoes with a given total number of spots | |
|---|---|
Complexity (1-100): 23
There is a full set of 28 dominoes: (0,0), (0,1),...,(6,6). For the given natural numbers Sum and N print the correct layout of exactly N tiles so that the number of spots on the tiles is equal to Sum.The
correct layout is a row of tiles such that each succeeding tile matches
the preceeding: (a,b) (b,c) (c,d) ... If there is no correct layout,
print the error messasge. Examples:
|
|
| Solution: | Show/hide explanation | Solution.hs |
Book of programming problems is powered by UseBB 1 Forum Software | Contact Admin