Mark As Completed Discussion

Solution 1: Recursion (brute force)

The most straightforward (and least efficient) solution is to explore every possibility using a backtracking algorithm.

JAVA
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment