04/22/2018
LeetCode 765 Couples Holding Hands

Problem

⭐️⭐️⭐️⭐️

Couples holding hands.

给一个array有2N个数表示N对couple, couple的定义就是(1,2)是couple, (3,4)是couple. 因为array是unsorted, 问要经过几次swap才能把所有的couple都挨在一起. 比如[1,2,3,4]或者[4,3,1,2]都是合理的结果.

Read More

© 2019 ReeeStart with help from Hexo and Twitter Bootstrap. Theme by Freemind.