Skip to content

Commit

Permalink
feat: day 20 solution
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushcodes0 committed Apr 15, 2024
1 parent 36bdf54 commit 7ec2289
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Easy/Day 20/solution.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
// Write your code here.
// Write your code here.
#include <bits/stdc++.h>
using namespace std;

int main(){
int n,x;
cin>>n>>x;
string s;
cin>>s;
for (int i = 0; i<n; i++){
if(x>0 && s[i] == 'x'){
x--;
}
else if(x>=0 && s[i] == 'o'){
x++;
}

}
cout<<x<<endl;



return 0;
}

0 comments on commit 7ec2289

Please sign in to comment.