https://ac.nowcoder.com/discuss/421720?type=101 题解里有很详细的分析