Skip to content

Commit

Permalink
Merge pull request #107 from ayushcodes0/day20
Browse files Browse the repository at this point in the history
Day20 solution
  • Loading branch information
shiwangi-07 authored Apr 15, 2024
2 parents d519453 + 7ec2289 commit 77ef960
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 77ef960

Please sign in to comment.