其实没看懂,但是提供了不同的思路,先记下
https://www.cnblogs.com/yuhangwang/p/11256476.html
https://www.cnblogs.com/yuhangwang/p/11258599.html