Now, instead outputting board configurations, return the total number of distinct solutions.
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Given a collection of intervals, merge all overlapping intervals.
Given an unsorted integer array, find the first missing positive integer.
Given a collection of distinct numbers, return all possible permutations.
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.