does anyone have any good resources on studying algorithmic logic in general? i solved the no repeats challenge now, but only did what the algorithm says to do.I really don’t get how it functions. i don’t like just doing what it says to do and hoping I’m doing it right. it also feels like cheating a little because i didn’t come up with a way on my own.

more details after the blur

I just solved, mostly anyway, “no repeats please” with only the more trivial part of regexing the resulting array.(I just solved the mutations part, and need a break!, it took 4 days just to implement it)

Now, this challenge did more than teach a simple task, it required me to REALLY research the algorithms out there for generating the permutations. here is the algo problem. I used heaps algorithm and got what it was doing, but I DO NOT UNDERSTAND WHY!

its just running 2 counters that are the length of the string, and sometimes switching to 0 and sometimes the actual count.(seemingly for no reason) then once the counts are incremented(or its time to be 0) switch the places of count A and count B.

I do get what its doing, but why 0 if the second counter of the algo is even?

why does it not work with say 1 instead of 0?

why does it not work with switching the first counter?

why does it not work if you don’t do the 0 switch?

i guess i will just need more studying on this topic.

So!, does anyone have any good resources for learning how to follow algorithm logic?