• 1
    Input and Output Data
    • Tasks
  • 2
    Conditions
    • Tasks
  • 3
    For Loop
    • Tasks
  • 4
    Strings
    • Tasks
  • 5
    While Loop
    • Tasks
  • 6
    Lists
    • Tasks
  • 7
    Two-Dimensional Arrays
    • Tasks
  • 8
    Dictionaries
    • Tasks
  • 9
    Sets
    • Tasks
  • 10
    Functions and Recursion
    • Tasks
  • к

Занятие 9. Sets

Difficulty level:

Task«We decide Sudoku»

💻 Python
Imagine that you play a simplified version of Sudoku on the 4x4 field. In this version, you need to fill empty cells with numbers from 1 to 4 so that in each line, each column and in each of the four squares of 2x2, each number was found only once. You are given a partially filled field of Sudoku. Write a program that will check whether the proposed number is an acceptable course for a certain cell.

Input format

First, 4 lines are introduced, which are the current state of the field of Sudoku. Each line contains 4 characters: numbers from 1 to 4 or symbol '.' (Point), denoting an empty cage.
row color is introduced num . & nbsp; row & nbsp; and & nbsp; color & nbsp;- these are the coordinates of the cell for which you want to verify the permissibility of the course (numbering begins with 0). & Nbsp; num is the number that you want to place in this cell

Output format

take "Yes" if the proposed move is permissible (that is, the number & nbsp; num & nbsp; cage & nbsp; (row, color) without violation of the rules of Sudoku). Otherwise, withdraw "No". The conclusion should be sorted

Example

Input

1.34
.41.
3..1
42.3
1 1 2

Output

Yes

Hint

There will be no clue here, decide for yourself!

main.py
Test 1
Test 2
Test 3
Test 4
Test 5
Test 6
Test 7
Test 8
Test 9
Test 10
Developer’s solution

🎉 Congratulations! 🎉

You did an excellent job with the task! It was a challenging problem, but you found the correct solution. You are one step closer to mastering programming! Keep up the good work, because every stage you pass makes you even stronger.

AD

Advertisement

red-snake blue-snake green-snake

Running your code...

Помощник ИИ

Привет! Я твой помощник по программированию. Задавай любые вопросы по Python, я могу рассказать о функциях, методах, обьяснить то, что тебе не понятно, а так же о текущей задаче!