perf: optimize stringPermutations with iterative approach and generat… - #140
Merged
Samarth2190 merged 2 commits intoOct 26, 2025
Merged
Conversation
Owner
|
The implementation looks good. Just two changes are required :-
Once these are fixed, we should be good to go. |
- Add detailed documentation for stringPermutations and stringPermutationsGenerator - Include performance optimization notes and memory usage considerations - Add usage examples for both permutation functions - Update TypeScript usage section with permutations examples - Add package-lock.json with updated dependencies
Contributor
Author
|
I've made the requested changes. Please review again. |
Samarth2190
approved these changes
Oct 26, 2025
Owner
|
Merging PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Performance Optimization: String Permutations
📝 Description
This PR addresses Issue #1: String Permutations Performance Problem by implementing a comprehensive optimization of the
stringPermutationsfunction.🎯 Problem Solved
✨ Solution Implemented
🔧 Core Optimizations
limitparameter🆕 New Features
stringPermutations(str, limit?): Enhanced with limit parameterstringPermutationsGenerator(str): Generator function for memory-efficient streaming📊 Performance Improvements
🎯 Key Benefits
🧪 Testing
📝 Usage Examples
🔄 Breaking Changes
None - This is a backward-compatible enhancement.
📁 Files Changed
src/transformations/stringPermutations.ts- Core optimization implementationsrc/transformations/index.ts- Export new generator functionsrc/tests/transformations/stringPermutations.test.ts- Enhanced test coverage🎯 Type of Change
✅ Checklist