Language: C++

#include <iostream>
using namespace std;

int main(){
    int row, column;
    cin >> row, column;
    

    vector<vector<string>> data(row, vector<string>(column));

    for (int i = 0; i < row; ++i){
        for (int j = 0; j < column; ++j){
            cin >> data.at(i).at(j);
            
        }
    }


    int counter_row = 0;
    int counter_column = 0;

    for (int i = 0; i < row; ++i){
        for (int j = 0; j < column; ++j){
            if(data.at(i).at(j) == "#")
                counter_row += 1;
             }

        if (counter_row != row - 1) {
            data.at(i).pop_back();
            row -= 1;

            }
        }  


    for (int i = 0; i < column; ++i){
        for (int j = 0; j < row; ++j){
            if(data.at(j).at(i) == "#")
                counter_column += 1;
             }

        if (counter_column != column - 1) {
            for(int j = 0; j < row; ++j){
                data.at(j).at(i).pop_back();
            }
            
            column -= 1;
            }
        } 


    for (int i = 0; i < new_row.size(); ++i){
        for (int j = 0; j < new_column.size(); ++j){
            
            cout << data.at(i).at(j);
            
            if(j = row.size() - 1){
                cout << endl;
            }
        }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<vector<string>> data(row, vector<string>(column));
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:9:25: error: expected primary-expression before '>>' token
    9 |     vector<vector<string>> data(row, vector<string>(column));
      |                         ^~
a.cc:9:51: error: expected primary-expression before '>' token
    9 |     vector<vector<string>> data(row, vector<string>(column));
      |                                                   ^
a.cc:13:25: error: overloaded function with no contextual type information
   13 |             cin >> data.at(i).at(j);
      |                         ^~
a.cc:24:21: error: overloaded function with no contextual type information
   24 |             if(data.at(i).at(j) == "#")
      |                     ^~
a.cc:29:18: error: overloaded function with no contextual type information
   29 |             data.at(i).pop_back();
      |                  ^~
a.cc:38:21: error: overloaded function with no contextual type information
   38 |             if(data.at(j).at(i) == "#")
      |                     ^~
a.cc:44:22: error: overloaded function with no contextual type information
   44 |                 data.at(j).at(i).pop_back();
      |                      ^~
a.cc:52:25: error: 'new_row' was not declared in this scope
   52 |     for (int i = 0; i < new_row.size(); ++i){
      |                         ^~~~~~~
a.cc:53:29: error: 'new_column' was not declared in this scope; did you mean 'column'?
   53 |         for (int j = 0; j < new_column.size(); ++j){
      |                             ^~~~~~~~~~
      |                             column
a.cc:55:26: error: overloaded function with no contextual type information
   55 |             cout << data.at(i).at(j);
      |                          ^~
a.cc:57:24: error: request for member 'size' in 'row', which is of non-class type 'int'
   57 |             if(j = row.size() - 1){
      |                        ^~~~
a.cc:61:6: error: expected '}' at end of input
   61 |     }
      |      ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^