Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Algorithmic Challenges
00:00
5 left

Algorithmic Challenges

MediumPython

Problem

Walk me through how you would approach solving algorithmic challenges like Valid Sudoku to test logical reasoning.

Implement is_valid_sudoku(board) to determine whether a partially filled 9x9 board is valid. A board is valid when each row, column, and 3x3 subgrid contains no repeated digits from 1 through 9, ignoring . cells. Return True for valid boards and False otherwise. The input is a list of nine lists, each containing nine single-character strings.

Constraints

  • board contains exactly 9 rows.
  • Each row contains exactly 9 strings.
  • Each cell is . or a digit from 1 through 9.
  • The board may be partially filled.

Function Signature

def is_valid_sudoku(board):
Interviewer

Your question is Algorithmic Challenges. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.