Concept Flow - String comparison (equals, compareTo)
Start
Get two strings
Use equals()
Are strings exactly same?
Yes→Return true
Return false
Use compareTo()
Compare lex order
Return negative/zero/positive
End
First, we check if two strings are exactly equal using equals(). Then, we compare their order lexicographically using compareTo(), which returns a number indicating their order.