From 7eb986344f28c0af9b11b50a9b8c623af83293bf Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Thu, 13 Jul 2023 00:28:41 +0600 Subject: [PATCH] initial commit --- 1811A Insert Digit/1811A.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 1811A Insert Digit/1811A.cpp diff --git a/1811A Insert Digit/1811A.cpp b/1811A Insert Digit/1811A.cpp new file mode 100644 index 0000000..cdb5a21 --- /dev/null +++ b/1811A Insert Digit/1811A.cpp @@ -0,0 +1,35 @@ +#include +using namespace std; +using ll = long long; + +void solve() +{ + int n; + char c; + cin >> n >> c; + string s; + cin >> s; + for (int i = 0; i < s.size(); ++i) + { + if (c > s[i]) + { + s.insert(i, 1, c); + cout << s << endl; + return; + } + } + s=s+c; + cout<> TC; + cin.ignore(); + while (TC--) + solve(); +} \ No newline at end of file