I tried case "RRWWRRW", "RR". The test program gave the expected answer -1. However, I thought the answer might be 2. Because:
"RRWWRRW" -> "RRWW[R]RRW" -> RRWWW -> RR -> RR[R] -> empty.
Could someone give me some ideas about it?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.