DEV Community

20+ basic Algorithms Problems from Coding Interviews

javinpaul on September 17, 2019

Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided i...
Collapse
 
clavinjune profile image
Clavin June

You can do swap better with XOR operator tho.

Collapse
 
javinpaul profile image
javinpaul

Yes, indeed, that's a nice trick for swapping. It's always better to bring such kind of alternative solution on real interviews, thanks for suggesting that.