forked from anupam-kumar-krishnan/Competitive_Programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3-6-9.cpp
More file actions
33 lines (33 loc) · 604 Bytes
/
Copy path3-6-9.cpp
File metadata and controls
33 lines (33 loc) · 604 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
vector<string> solve(int n) {
vector<string>v;
int flag=0;
for(int i=1;i<=n;i++)
{
if(i%3==0)
{
v.push_back("clap");
}
else
{
string s=to_string(i);
for(int i=0;i<s.length();i++)
{
if(s[i]=='3' || s[i]=='6' || s[i]=='9')
{
flag=1;
v.push_back("clap");
break;
}
}
if(flag==0)
{
v.push_back(s);
}
else
{
flag=0;
}
}
}
return v;
}