resolved this algorithm problem and used the ternary operator which is pretty interesting. It was a good experience for sure!
return text1 == text2 ? true : false;