For this Question: Given an integer N and a string S of length (N-1) containing only characters '0' and '1'. Find an array Arr which contains N integers, such that:
> All the values of the array are distinct
> Maximum value of the array can be N
> For i from 1 to N-1 
 if S[i] == '0'
 Arr[i] > Arr[i+1]
 if S[i] == '1'
 Arr[i] < Arr[i+1]
> Arr is lexographically maximum possible

Note:- It can be proven that it will always be possible to create an array Arr satisfying above conditions.First line of input contains a single integer N.
Second line of input contains the string S of length N-1.

Constraints
2 <= N <= 100000
|S| = (N-1)
S contains characters '0' and '1' only.Print N space separated integers, denoting the array Arr.Sample Input 1
5
0001

Sample Output 1
5 4 3 1 2

Explanation
as S[1] == 0, A[1] > A[2]
as S[2] == 0, A[2] > A[3]
as S[3] == 0, A[3] > A[4]
as S[4] == 1, A[4] < A[5]
this is lexographically maximum array possible.

Sample Input 2
6
11100
Sample Output 2
3 4 5 6 2 1, I have written this Solution Code: #pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountll
#define m_p make_pair
#define infi 1e18+1
#define eps 0.000000000001
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
string char_to_str(char c){string tem(1,c);return tem;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class T>//usage rand<long long>()
T rand() {
    return uniform_int_distribution<T>()(rng);
}
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template<class T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
 
//////////////
auto clk=clock();
#define all(x) x.begin(),x.end()
#define S second
#define F first
#define sz(x) ((long long)x.size())
#define int long long  
#define f80 __float128
#define pii pair<int,int>
/////////////

signed main()
{
	fastio;
	#ifdef ANIKET_GOYAL
		freopen("inputf.in","r",stdin);
		freopen("outputf.in","w",stdout);
	#endif
	int n;
	cin>>n;
	string s;
	cin>>s;
	int M = n;
	for(int i=0;i<n-1;++i) {
		int c = 0;
		while(i < n && s[i] == '1') {
			++i;
			++c;
		}
		for(int j=M-c;j<=M;++j) 
			cout<<j<<" ";
		M -= c + 1;
	}
	if(M) cout<<M;
	#ifdef ANIKET_GOYAL
		// cout<<endl<<endl<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
	#endif
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?