Given a string path of moves where each character is 'N', 'S', 'E', or 'W' (starting at the origin), determine whether the path ever revisits a point it has already been to (including the origin). Return true if it crosses itself, else false. The input is JSON {path}.
Input: JSON {path}.
Output: Boolean — true if the path crosses itself.
Input: {"path":"NES"}
Output: false
Explanation: No point revisited.Input: {"path":"NESWW"}
Output: true
Explanation: Returns to a visited point.Input: {"path":"N"}
Output: false
Explanation: Single move.0<=length<=10^4moves are N/S/E/W