include <bits/stdc++.h>
using namespace std;
int beautiful_year(int y) { int flag=0,i=0,digit[10],j=0; while(y) { digit[i++]=y%10; y=y/10; } int size=sizeof(digit)/sizeof(digit[0]); for(i=0;i<size;i++) { for(j=i;j<size;j++) { if(digit[i]==digit[j]) return 0; else flag=1;
} } if(flag==1) return 1; else return 0; } int main() { int year; cin>>year; year++; while(year) { if(beautiful_year(year)) { cout<<year; break; } year++; } return 0; }
The code has been down voted. can you please tell me as I a beginner on this platform
maybe format it correctly? or just read the editorial.
```cpp
Code goes here
```
And if the code is too long, you can use the spoiler like above
Any how, here is what you should do when writting an asking blog
You should describe main things in your problem: The statement, constraint, give some examples....
Then describe your approach, your problem, paste your code...
Finally ask for a solution, better way
By the way, dont be pressure when you lost your contribution (but you should notice to improve your comment, blogs, ...). Since it use weird calculating system. Once I got over $$$500$$$ downvotes with $$$-55$$$ contributions but that doesnt matter on my rate
You need to use Markdown bro.
```
cpp
code is here. `````