Hacker News new | past | comments | ask | show | jobs | submit login

Not trivial - I do not see how to solve [3, 2, 1] without this kind of swapping. Perhaps we need to clarify the rules for a starting point first.



I mean that if you allow swapping then every instance of the problem becomes trivial because swapping is all that reversing is. Doesn’t mean the problem as intended is always solvable.


Learn Forth. Consequent swappings will reverse an stack.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: