Help me in solving SUSSTR problem

My issue

Not able to solve

My code

def suspense_string(s):
    alice_turn = True
    alice_str = ""
    bob_str = ""

    while s:
        if alice_turn:
            # Alice's turn: Choose the lexicographically smaller character
            if s[0] <= s[-1]:
                alice_str += s[0]
                s = s[1:]
            else:
                alice_str += s[-1]
                s = s[:-1]
        else:
            # Bob's turn: Choose the lexicographically larger character
            if s[0] <= s[-1]:
                bob_str += s[0]
                s = s[1:]
            else:
                bob_str += s[-1]
                s = s[:-1]

        alice_turn = not alice_turn

    return alice_str + bob_str[::-1]

# Input reading and processing
t = int(input("Enter the number of test cases: "))
for _ in range(t):
    n = int(input())
    binary_string = input().strip()
    resultant_string = suspense_string(binary_string)
    print(resultant_string)
    

Learning course: Stacks and Queues
Problem Link: Suspense String Practice Problem in Stacks and Queues - CodeChef

@iam_mustafa
plzz refer my c++ code for better understanding of logic and implementation .

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
        int t;
        cin>>t;
        while(t--)
        {
            int n;
            cin>>n;
            string s,s1;
            cin>>s;
            for(int i=0,j=n-1,k=0;i<=j;k++)
            {
                if(k%2==0)
                {
                   // cout
                    if(s[i]=='1')
                    s1.push_back('1');
                    else
                    s1="0"+s1;
                    i++;
                }
                else
                {
                    if(s[j]=='0')
                    s1.push_back('0');
                    else
                    s1="1"+s1;
                    j--;
                }
             //  cout<<s1<<endl;
            }
            cout<<s1<<endl;
        }
}