Sample input. [['1', '.', '.', '.', '.', '3', '.'], ['.', '.', '.', '.', '.', '.', '.'], ['.', '1', '.', '.', '0', '.', '.'], ['.', '.', '.', '2', '.', '.', '.'], ['.', '3', '.', '.', '.', '.', '3'], ['.', '.', '.', '.', '1', '.', '.'], ['.', '.', '.', '1', '.', '.', '1']] Solution with stars: [['1', '★', '.', '.', '★', '3', '★'], ['.', '.', '.', '.', '.', '.', '★'], ['.', '1', '.', '.', '.', '.', '.'], ['.', '.', '★', '2', '.', '.', '★'], ['.', '3', '★', '.', '.', '★', '3'], ['.', '.', '★', '.', '1', '.', '★'], ['.', '.', '.', '1', '.', '.', '1']] Output: Solution (list of tuples containting the 10 stars): [(0, 1), (0, 4), (0, 6), (1, 6), (3, 2), (3, 6), (4, 2), (4, 5), (5, 2), (5, 6)]
Sample input.
[['1', '.', '.', '.', '.', '3', '.'], ['.', '.', '.', '.', '.', '.', '.'], ['.', '1', '.', '.', '0', '.', '.'], ['.', '.', '.', '2', '.', '.', '.'], ['.', '3', '.', '.', '.', '.', '3'], ['.', '.', '.', '.', '1', '.', '.'], ['.', '.', '.', '1', '.', '.', '1']]
Solution with stars:
[['1', '★', '.', '.', '★', '3', '★'], ['.', '.', '.', '.', '.', '.', '★'], ['.', '1', '.', '.', '.', '.', '.'], ['.', '.', '★', '2', '.', '.', '★'], ['.', '3', '★', '.', '.', '★', '3'], ['.', '.', '★', '.', '1', '.', '★'], ['.', '.', '.', '1', '.', '.', '1']]
Output:
Solution (list of tuples containting the 10 stars):
[(0, 1), (0, 4), (0, 6), (1, 6), (3, 2), (3, 6), (4, 2), (4, 5), (5, 2), (5, 6)]
![Tentaizu is a classic Japanese game that consists of a 7x7 board of which 10 of those 49 slots are
"stars". The objective of the game is to determine the position of these stars. To help with
identifying the correct position, some slots contain hints in the form of numbers. These hints work
like the number hints in minesweeper in the sense that it identifies how many stars are adjacent to
the slot. The range of values are from 0 (no stars) to 8 (fully surrounded by stars). A Tentaizu puzzle
contains only these number hints. Much like other puzzle games like sudoku, there is only one
combination of star positions that is described by the puzzle.
Your task is to create a solver function for a given Tentaizu puzzle using python. This function
should be able to recursively solve the puzzle. Define a function "solve" with the input variable
being a 7x7 list representing the Tentaizu puzzle. The return value should be a list of tuples
containing the correct coordinates of the 10 stars. If there is no valid solution, it should return an
empty list instead: [] = solve(puzzle)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Faa419de0-a626-4205-90f5-0b472d257599%2F95f448de-4f3a-4b4e-9516-a59841f0358d%2Fxvatai9_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
incorrect solution. different with the screenshot
Processing time is too long. cannot execute solution
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)