fa
Feedback
OA Help : Interview Help

OA Help : Interview Help

رفتن به کانال در Telegram

Codeforces Codechef Leetcode AtCoder GFG CodeStudio All Contests Solutions available.

نمایش بیشتر
898
مشترکین
اطلاعاتی وجود ندارد24 ساعت
-47 روز
-1430 روز
آرشیو پست ها
https://leetcode.com/Virus_ARzk/ https://leetcode.com/rohitashwa01/ Anyone wants these IDs? Very cheap price, dm me ☠️

if anyone wants to buy this Codeforces id, dm me @cp_wala https://codeforces.com/profile/Loki_Coder

if anyone wants to buy this Codeforces id, dm me @cp_wala https://codeforces.com/profile/Loki_Coder

🥳🥳

D done

@cp_Wala dm fast

photo content

B done ✅

A done

Get ready for CF

Bhai koi AtCoder de raha hai to please Q2 ka testcase explain kardo 🥺 @cp_wala

void code() { int n; cin >> n; vector arr(n); for (int &i : arr) cin >> i; int minIndex = 0; for (int i = 0; i < n; i++) if (arr[i] < arr[minIndex]) minIndex = i; int res = minIndex; for (int i = minIndex; i < n - 1; i++) if (arr[i] > arr[i + 1]) res = -1; cout << res << endl; } // E // Enjoy ❤️

E solution Find the smallest element index and if the array is sorted from there then print its index otherwise if not sorted print -1

photo content

void solve() { int n; cin >> n; vi arr(n); for (int i = 0; i < n; i++) cin >> arr[i]; map freq; for (int i = 0; i < n; i++) freq[arr[i]]++; int res = 0; for (auto e : freq) res += e.second * (e.second - 1) / 2; res += freq[1] * freq[2]; cout << res << endl; } // D // Here it is, enjoy❤️😁

D is also easy, just count the frequency of each element Then add nC2 for every n belongs to frequency and there is special case that 2^4 = 4^2 so just add the product of freq of 2 and freq of 4 😁❤️

B is brute force Check for every factor of n calculate max min for each one and find the max difference between them

Silly mistakes, lol
Silly mistakes, lol

😁
😁