Code with Cisco OA Help : Interview Help
916 subscribers
413 photos
2 videos
29 links
Codeforces
Codechef
Leetcode
AtCoder
GFG
CodeStudio

All Contests Solutions available.
Download Telegram
Get ready for Codeforces Div. 3 ๐Ÿ”ฅ
๐Ÿ‘1
if (n % 3)
cout << "First\n";
else
cout << "Second\n";
// A
Use LLONG_MAX if you are using INT_MAX
๐Ÿ˜
โค4
Silly mistakes, lol
โค3
B is brute force
Check for every factor of n
calculate max min for each one and find the max difference between them
๐Ÿ‘Ž11โค5๐Ÿ‘1
D is also easy, just count the frequency of each element
Then add fC2 for every frequency
and there is special case that 2^4 = 4^2 so just add the product of freq of 2 and freq of 4 ๐Ÿ˜โค๏ธ
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
void code()
{
int n;
cin >> n;
vector<int> 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 โค๏ธ
โค11๐Ÿ‘Ž4๐Ÿ‘1
A and B done โœ… codeforces
Dm fast, time's running ๐Ÿ˜
Anyone wants to buy 4 โญ๏ธ codechef id, dm me ๐Ÿ’ซ
@cp_wala
Anyone wants to buy Leetcode Guardian ID dm me ๐Ÿ˜
@cp_Wala
๐Ÿ‘Ž2๐Ÿ”ฅ1
Channel name was changed to ยซCodeforces and Codechef Solutionsยป