initial commit

This commit is contained in:
ShazidMahsrafi 2023-07-24 00:09:17 +06:00
parent 95ef276560
commit 0237de6a07

View File

@ -0,0 +1,52 @@
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
int n;
cin >> n;
bool beautiful = false;
while (!beautiful)
{
n++;
vector<int> v;
int temp = n;
while (temp > 0)
{
int r;
r = temp % 10;
temp = temp / 10;
v.push_back(r);
}
bool same = false;
for (int i = 0; i < v.size() - 1; ++i)
{
if (same)
break;
for (int j = i + 1; j < v.size(); ++j)
{
if (v[i] == v[j])
{
same = true;
break;
}
}
}
if (!same)
beautiful = true;
}
cout<<n<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int TC = 1;
// cin >> TC;
// cin.ignore();
while (TC--)
solve();
}