A Generalized Backtracking Approach
NOTE: This is my attempt at explaining it, but it's still very convoluted. Will reword it. Thanks ChatGPT for this.
Main Function
The main function sets up the initial conditions for backtracking.
MainFunction(input, target)
 Initialize an empty list to store results.
 Sort input array if necessary.
 Call Backtrack function with initial parameters.
Backtrack Function
The Backtrack function does the core work of forming combinations, subsets, or permutations.
Backtrack(resultList, tempList, input, target, start, used)

Base Cases:
 If target is reached, add tempList to resultList.
 If target is not reachable, return.
 If tempList size matches input size, add tempList to resultList.

Loop from 'start' to end of 'input':
 If the element should be skipped, continue. // For duplicates or used elements
 Update tempList and target based on the problem.
 Update 'used' array if it exists. // Recursive call to Backtrack with updated tempList and target
 Backtrack(resultList, tempList, input, newTarget, newStart, used)
 Revert tempList, target, and 'used' array to original state.
Key Notes
 resultList: Holds the final lists (subsets, permutations, combinations, etc.)
 tempList: Holds the current list being formed.
 input: Original data to use for forming lists.
 target: Could be a sum, length, or any other condition to meet.
 start: Represents the index to start from in the current iteration.
 used (optional): Keeps track of elements that have been used.
Reference: A general approach to backtracking questions in Java