C ++ implementation to extract the secret message
#include <bits/stdc++.h> NEW_LINE using namespace std ; string trim ( const string & s ) { auto start = s . begin ( ) ; while ( start != s . end ( ) && isspace ( * start ) ) start ++ ; auto end = s . end ( ) ; do { end -- ; } while ( distance ( start , end ) > 0 && isspace ( * end ) ) ; return string ( start , end + 1 ) ; }