Charges lunchtime What is wrong with my

Why this Code is giving WA

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const long long int mod=1e9+7;

int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;cin>>t;
while(t–){
ll n,k;cin>>n>>k;
string s;cin>>s;
char arr[n];
for(int i=0;i<n;i++){
arr[i]=s[i];
}
ll dis=0;
for(ll i=0;i<n-1;i++){
if(arr[i]==arr[i+1]){
dis+=2;
}
else dis+=1;
}
ll pos;
for(ll i=0;i<k;i++){
cin>>pos;
pos–;
if(arr[pos]==‘1’){
arr[pos]=‘0’;
}
else arr[pos]=‘1’;
if(pos==0){
if(arr[1]==arr[0]){
dis++;
}
else dis–;
}
else if(pos==n-1){
if(arr[n-1]==arr[n-2]){
dis++;
}
else dis–;
}
else{
if(arr[pos]==arr[pos+1]){
dis++;
}
else{
dis–;
}
if(arr[pos]==arr[pos-1]){
dis++;
}
else{
dis–;
}
}
cout<<dis<<"\n";
}
}
}

I did quite similar but still getting WA after repeated attempts using sample test cases