Sasquatch, the guardian of the forest, has hidden his most precious possessions in a secure password vault deep within the heart of the woods. Unfortunately, Sasquatch has forgotten the master password to his vault! As brave adventurers, we've been entrusted with the task of cracking Sasquatch's password to access his hidden treasures.
The password is a combination of lowercase letters (a-z) and numbers (0-9). However, Sasquatch can't recall the exact combination he set. To aid in our quest, we must write a program that recursively generates all possible combinations of passwords of a given length and checks each one against the vault until we find the correct password.
Stone vault in the middle of the forest. Image generated by Microsoft's Copilot.
Write a recursive function to crack Sasquatch's password. The password consists of a combination of lowercase letters and numbers. Participants must generate all possible combinations of passwords of a given length and compare them to the correct password until they find the correct one. An additional parameter (maxLength) should be passed in to the function to ensure that there's a limit to the recursion.