encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:7:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
7 | for(i=0; i<N; i++)
| ^~~
encoder.cpp:9:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
9 | string st = to_string(num);
| ^~~~~~
encoder.cpp:8:9: warning: unused variable 'num' [-Wunused-variable]
8 | int num = i;
| ^~~
encoder.cpp:9:5: error: 'string' was not declared in this scope
9 | string st = to_string(num);
| ^~~~~~
encoder.cpp:10:11: error: expected ';' before 's2'
10 | string s2 = to_string(M[i]);
| ^~~
| ;
encoder.cpp:11:11: error: expected ';' before 'f'
11 | string f = st+s2;
| ^~
| ;
encoder.cpp:12:23: error: 'f' was not declared in this scope
12 | int number = stoi(f);
| ^
encoder.cpp:12:18: error: 'stoi' was not declared in this scope
12 | int number = stoi(f);
| ^~~~
decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:7:3: error: 'map' was not declared in this scope
7 | map<int,int> mp;
| ^~~
decoder.cpp:7:7: error: expected primary-expression before 'int'
7 | map<int,int> mp;
| ^~~
decoder.cpp:10:5: error: 'string' was not declared in this scope
10 | string s = to_string(b);
| ^~~~~~
decoder.cpp:11:13: error: 's' was not declared in this scope
11 | int n = s.length();
| ^
decoder.cpp:14:11: error: expected ';' before 'tmp'
14 | string tmp = "";
| ^~~~
| ;
decoder.cpp:16:13: error: 'tmp' was not declared in this scope
16 | tmp += s[j];
| ^~~
decoder.cpp:18:20: error: 'tmp' was not declared in this scope
18 | int num = stoi(tmp);
| ^~~
decoder.cpp:18:15: error: 'stoi' was not declared in this scope
18 | int num = stoi(tmp);
| ^~~~
decoder.cpp:19:5: error: 'mp' was not declared in this scope
19 | mp[num] = digit;
| ^~
decoder.cpp:21:14: error: 'mp' was not declared in this scope
21 | for(auto z:mp){
| ^~