HN Top New Show Ask Jobs

settings

Theme

Hand Mode

Feed

Comment by monkeyelite

Comment by monkeyelite 8 hours ago

0 replies

View on Hacker News

Interesting… I’m sure you resolved this. But the textbook solution is:

1. std::find last

2. std::iter_swap(first, found)

3. std::sort(front + 1, back)