In C++, Write a function that transforms a string such that sequences of consecutive underscores become a single underscore. E.g. (‘_hello___world__’ => ‘_hello_world_’).
Related to the question: Consolidate multiple characters to one character in c++. abbbcc -> abc
without the libraries: