Phenom Interview Question

Swap 2 strings without using a third variable.

Interview Answer

Anonymous

Oct 21, 2025

concat the 2 strings, then use s2 = substring(0, s1.length()-s2.length()) and s1 = substring(s2.length())