Backtracking

Categories: Code Problem / Data Structures and Algorithms / Recursion (32) Code Problem / Data Structures and Algorithms / Binary Search (30) Code Problem / Data Structures and Algorithms / Linked Lists (26) Code Problem / Data Structures and Algorithms / Backtracking (26) Code Problem / Data Structures and Algorithms / Stacks and Queues (25) Code Problem / Data Structures and Algorithms / Hashing (24) Databases / SQL / Backup and Recovery (19) Code Problem / Data Structures and Algorithms / Arrays and Strings (19) Databases / SQL / Database Normalization (18) Code Problem / Data Structures and Algorithms / Time Complexity (17) Databases / SQL / Locking (16) Databases / SQL / Replication (15) Databases / SQL / SQL Queries (13) Code Problem / Data Structures and Algorithms / Graphs (13) Databases / SQL / Database Security (13)  More...

Recent solutions:

Check these solutions from our community:
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This function takes in a 2D array and determines if it is a valid Sudoku board. A Sudoku board is valid if each row, column, and 3x3 subarray contains exactly 9 integers.
About this solution: The candidate's solution correctly solves the problem. The solution is complete, with functions to check rows, columns, and 3x3 subarrays. The candidate's approach is clear and easy to follow.
Nov 09
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This is a backtracking problem where the goal is to find the longest path of consecutive integers in a 2D array, starting from the top left corner. The path can only move up, down, left, or right, and each cell can only be visited once.
About this solution: The candidate's solution is a depth first search algorithm that starts at the top left corner of the array and searches for the longest path. If the algorithm finds a path that is longer than the current longest path, it will update the longest path. The algorithm will continue to search for the longest path until it has visited every cell in the array. The algorithm will then return the longest path. The solution is complete and solves the problem. The approach is general and could be applied to other problems.
Nov 08