Remove extra spaces in the string in-place by C++Given a string with extra spaces. It is needed to remove all extra spaces (including trailing and leading spaces) so that all words have…Jul 1, 2021Jul 1, 2021