Skip to content

Conversation

@ErdemT09
Copy link
Collaborator

@ErdemT09 ErdemT09 commented May 5, 2021

The main process of this algorithm is like this:
If we have some letters inside the braces, then the result is just of concatenation of these strings and "brace expansion" of the rest of the string.
The TreeSet is responsible for lexographically sorting these strings.

Additionally, there is also a possible solution with the list. This can also be added.
The credit for the code goes here.

@altay9
Copy link
Collaborator

altay9 commented May 5, 2021

Hello Erdem,
This solution is quite fine and takes 10 ms.
As this is also a String processing question, a recursive solution is also appropriate for that problem, similar to this:
#117

In this case, we would be using a StringBuilder instead of a TreeNode in order to reconstruct the string.

When we are available for that hypothetic solution, we can meditate on it as well.

I approved this one. Thanks for your valuable effort and attention.

@altay9 altay9 mentioned this pull request May 5, 2021
@ErdemT09 ErdemT09 merged commit 7ea0765 into master May 6, 2021
@ErdemT09 ErdemT09 deleted the 1087.-Brace-Expansion branch May 6, 2021 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants