Please give the reasons and intuitions in the answers. Code is not hard to write
people should try and give the proof as to why this solution works instead of just posting their codes.
people should try and give the proof as to why this solution works instead of just posting their codes.
['C++']