CODING SOLUTIONS | IBM | AMAZON CODING SOLUTIONS
Open in Telegram
8 815
Subscribers
No data24 hours
-207 days
-11730 days
Posts Archive
Successfully Done with afternoon slot 28th Augustπ
Full Exam help done in premium group foundation+Advanced sections π―π
β
β
β
β
β
β
β
β
β
π―π―π―π―π―π―π―π―π―π―π―π―π―πππππππππππ
@tcs_rolex
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> vec(n, 0);
for (int i = 0; i < n; i++)
{
vec[i];
}
int ans = 1;
for (int i = 1; i < n; i++)
{
if (vec[i - 1] < vec[i])
{
int t = vec[i] - vec[i - 1];
int m = max(m, t);
ans += m;
}
else
{
ans++;
}
}
cout << ans;
return 0;
}
π
Telegram - Shareβ
β
ππ
https://t.me/coding_solutions_all
@tcs_nqt_answers_August
map umap;
vector ans;
for (auto x : words)
{
string t = x;
sort(x.begin(), x.end());
umap[x]++;
}
for (auto x : umap)
{
if (t <= x.second)
ans.push_back(x.first);
}
return ans;
C++ language
Write in side of functions
#include <bits/stdc++.h>
using namespace std;
int getSum(int n)
{
if (n < 10)
{
if (n == 1)
return 1;
else
return 0;
}
int sum = 0;
while (n != 0)
{
sum = sum + n % 10;
n = n / 10;
}
return getSum(sum);
}
int main()
{
int n;
cin>>n;
cout<<getSum(n);
return 0;
}
C++ language
If anyone want to join premium group ?
Join before 1:50PM
Don't message during exam no use
@tcs_rolex
