The substring() method in Java is a powerful tool for extracting portions of a string. It allows you to create a new string based on the characters within a specified range of an existing string.
// Helper function to perform depth-first search (DFS) to find the maximum // number of unique substrings we can split the string 's' into.