We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92de045 commit c2c4b25Copy full SHA for c2c4b25
1729B - Decode String.cpp
@@ -0,0 +1,39 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+#define ll long long
5
+
6
+// Code Written By: Vikash Patel
7
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8
9
+int main()
10
+{
11
+ ios_base::sync_with_stdio(0);
12
+ cin.tie(0);
13
14
+ int t;
15
+ cin>>t;
16
+ while(t--)
17
+ {
18
+ int n;
19
+ cin>>n;
20
+ string s;
21
+ cin>>s;
22
+ string ans;
23
+ for(int i=0; i<n;)
24
25
+ if(s[i+2] == '0' && s[i+3] != '0')
26
27
+ ans += 96+stoi(s.substr(i,2));
28
+ i += 3;
29
+ }
30
+ else
31
32
+ ans += 96+(s[i]-'0');
33
+ i++;
34
35
36
+ cout<<ans<<endl;
37
38
+ return 0;
39
+}
0 commit comments