Given a string path, where each character represents a movement on a
'N' moves
'S' moves
'E' moves
'W' moves
You start at the origin path.
Return true if the path crosses itself at any point (visiting any coordinate that has already been visited), and false otherwise.
Constraints:
path.length
path[i] is either 'N', 'S', 'E', or 'W'.
Given a string path, where each character represents a movement on a
'N' moves
'S' moves
'E' moves
'W' moves
You start at the origin path.
Return true if the path crosses itself at any point (visiting any coordinate that has already been visited), and false otherwise.
Constraints:
path.length
path[i] is either 'N', 'S', 'E', or 'W'.