0

help string permutation

https://sololearn.com/compiler-playground/cTHLRAnirS6N/?ref=app so i have this code and its outputting dog, odg, ogd, dgo, gdo, god but i need it to input dog, dgo, odg, ogd, gdo, god can someone help me figure out what to tweak thx

19th Oct 2025, 1:23 AM
AcnkKRuv5A
2 Respuestas
+ 2
Just swap the two for loops: for index in range(len(aSet)): for permutation in partial: https://sololearn.com/compiler-playground/cQI9xhD23mAH/?ref=app
19th Oct 2025, 2:05 AM
BroFar
BroFar - avatar
+ 1
maybe opt for a lazier solution: also, most common Python libraries are written in C or C++, so they 're probably faster than pure Python solutions. but implementing them yourself in Python is a good exercise in understanding the algorithm and getting proficient in the language you're learning. https://sololearn.com/compiler-playground/cr89JTqZOOKG/?ref=app
19th Oct 2025, 3:05 AM
Bob_Li
Bob_Li - avatar