online assessment| ALL at one Point |
8.31K subscribers
11 photos
3 files
7 links
Free copy paste solution of all major coding contest and OAs....

We provide all codes for free with regular internships and job updates

Join for all in one place....from codes to regular job updates everything

Discussion grp - https://t.me/oadiscussion
Download Telegram
uber all code shared working
โค4
https://t.me/oahelp -> share with your friends for free OA sol and materials for free...๐Ÿ™‚
โค4๐Ÿ‘1
next OA comment here?
โšก6
https://t.me/oadiscussion -> join discussion grp for oa help and all send your OA ques here so that i can solve and other people too...
โค3
Channel name was changed to ยซMedia.net Oracle| Deshaw| Uber|Google| Microsoft| Sprinkler| Codeforces| Codechef| leetcode| Gfg| OAs solutionยป
Channel name was changed to ยซMedia.net |Oracle| Deshaw| Uber|Google| Microsoft| Sprinkler| Codeforces| Codechef| leetcode| Gfg| OAs solutionยป
Microsoft tomm?
Anonymous Poll
51%
Yes
49%
No
microsoft 13july oa.pdf
336.4 KB
microsoft oa material
โค14๐Ÿ‘4
Thoda support Karo guys 1000 subscriber's karwa do....will try to bring more oa and solutions like this for free...
โค14โšก3๐Ÿ‘1
class DisjointSetUnion {
public:
void initialize(int numberOfElements) {
parent.resize(numberOfElements);
for (int i = 0; i < numberOfElements; ++i)
parent[i] = i;
}

int findRoot(int element) {
if (parent[element] != element)
parent[element] = findRoot(parent[element]);
return parent[element];
}

void unite(int element1, int element2) {
int root1 = findRoot(element1);
int root2 = findRoot(element2);
if (root1 != root2)
parent[root1] = root2;
}

private:
vector<int> parent;
};

string solve(vector<string>& words) {
int wordCount = words.size();

DisjointSetUnion dsu;
dsu.initialize(26);
vector<int> inDegrees(26, 0);
vector<int> outDegrees(26, 0);
vector<bool> isConnected(26, false);

string result;
for (int k = 0; k < wordCount; ++k) {
int start = words[k][0] - 'a';
int end = words[k].back() - 'a';
outDegrees[start]++;
inDegrees[end]++;
dsu.unite(start, end);
isConnected[start] = isConnected[end] = true;

int root = dsu.findRoot(start);
unordered_set<int> roots;
for (int i = 0; i < 26; ++i) {
if (isConnected[i] && (inDegrees[i] > 0 || outDegrees[i] > 0))
roots.insert(dsu.findRoot(i));
}

if (roots.size() > 1) {
result.push_back('0');
continue;
}

vector<int> differences;
for (int i = 0; i < 26; ++i) {
if (isConnected[i] && (inDegrees[i] > 0 || outDegrees[i] > 0))
differences.push_back(outDegrees[i] - inDegrees[i]);
}

if (!differences.empty()) {
int maxDifference = *max_element(differences.begin(), differences.end());
int minDifference = *min_element(differences.begin(), differences.end());
if (!((maxDifference == 0 && minDifference == 0) || (maxDifference == 1 && minDifference == -1 && count(differences.begin(), differences.end(), 1) == 1 && count(differences.begin(), differences.end(), -1) == 1))) {
result.push_back('0');
continue;
}
}

result.push_back('1');
}

return result;
}
MS 2nd
โค12๐Ÿ‘7
int countGoodSubsets(std::vector<int>& numbers) {
int maskArray[31] = {-1, 0, 1, 2, -1, 4, 3, 8, -1, -1, 5, 16, -1, 32, 9, 6, -1, 64, -1, 128, -1, 10, 17, 256, -1, -1, 33, -1, -1, 512, 7 };
int dp[1025] = {1}, count[31] = {};

for (int i = 0; i < numbers.size(); ++i)
++count[numbers[i]];

for (int i = 2; i <= 30; ++i) {
if (maskArray[i] > -1) {
for (int mi = maskArray[i], mj = 0; mj < 1024; ++mj) {
if ((mi & mj) == 0) {
dp[mi | mj] = (dp[mi | mj] + (long long)count[i] * dp[mj]) % 1000000007;
}
}
}
}

int result = std::accumulate(begin(dp) + 1, end(dp), 0, [](int sum, int num) { return (sum + num) % 1000000007; });

while (--count[1] >= 0)
result = (result << 1) % 1000000007;

return result;
}
OMEGA AC
โค4๐Ÿ‘1
Send your coding ques and OA (any) ques here in this grp....other people and I will try to help you in yours OA's for free...just send your ques in this grp
https://t.me/oadiscussion
โค10
#include <bits/stdc++.h>
using namespace std;

int main() {
int num_items, num_groups;
cin >> num_items >> num_groups;

vector<int> items(num_items);
for (int i = 0; i < num_items; ++i) {
cin >> items[i];
}

vector<int> group_sizes(num_groups);
for (int i = 0; i < num_groups; ++i) {
cin >> group_sizes[i];
}

sort(items.rbegin(), items.rend());

int max_profit = 0;
int idx = 0;
for (int i = 0; i < num_groups; ++i) {
int group_size = group_sizes[i];
while (idx < num_items && group_size > 0) {
max_profit += items[idx];
idx++;
group_size--;
}
}

cout << max_profit << endl;

return 0;
}
seat booking sprinkler
โค4๐Ÿ‘3
#include <bits/stdc++.h>
using namespace std;

int main()
{
int numElements;
cin >> numElements;
vector<int64_t> minCost(numElements + 2, 0x3f3f3f3f3f3f3f3f);
minCost[0] = 0;
vector<int> range(numElements + 2), elementCost(numElements + 2);

for (int i = 1; i <= numElements + 1; i++)
{
cin >> range[i];
}
for (int i = 1; i <= numElements + 1; i++)
{
cin >> elementCost[i];
}

for (int i = 1; i <= numElements + 1; i++)
{
if (range[i] == 0)
continue;

int nextIdx = min(i + range[i], numElements + 1);
int prevIdx = max(i - range[i] - 1, 0);
int64_t prevElementCost = elementCost[prevIdx];
for (int j = prevIdx + 1; j <= nextIdx; j++)
{
minCost[j] = min(minCost[j], minCost[prevIdx] + elementCost[i]);
}
}

cout << ((minCost[numElements + 1] < 0x3f3f3f3f3f3f3f3f) ? minCost[numElements + 1] : -1) << "\n";
}

Garden
โค6๐Ÿ‘5
#include <iostream>
using namespace std;

int findMaximum(int a, int b)
{
return a > b ? a : b;
}

int findMinimum(int a, int b)
{
return a < b ? a : b;
}

int main()
{
int numRows, numCols;
cin >> numRows >> numCols;

int maximumValue = -0x3f3f3f3f;
int result = -0x3f3f3f3f;
for (int i = 0; i < numRows; i++)
{
for (int j = 0; j < numCols; j++)
{
int cellValue;
cin >> cellValue;
int currentDifference = maximumValue - cellValue;
result = findMaximum(result, currentDifference);
maximumValue = findMaximum(maximumValue, cellValue);
}
}
cout << result << "\n";
}
(dhoni sir) 2 tc fail
๐Ÿ”ฅ3๐Ÿ‘1
#include <iostream>
#include <string>
using namespace std;

int main()
{
int numElements;
cin >> numElements;
char prevChar, currentChar;
cin >> currentChar;
string result;

for (int i = 2; i <= numElements; i++)
{
prevChar = currentChar;
cin >> currentChar;
if (currentChar == '*')
{
continue;
}
if (currentChar == '_' || currentChar == 'D')
{
if (prevChar == '*')
{
result.push_back('J');
}
else
{
result.push_back('W');
}
}
}
if (numElements == 1)
{
result = 'W';
}
cout << result << endl;
}

LOST IN WOODS
โค4๐Ÿ‘1
#include <bits/stdc++.h>
using namespace std;

using pii = pair<int, int>;
#define ll long long
#define test_cases \
int t; \
cin >> t; \
while (t--)
#define read_array \
int arr[n]; \
for (int i = 0; i < n; i++) \
cin >> arr[i]

bool comparePair(pii p1, pii p2)
{
if (p1.first < p2.first)
return false;
else if (p1.first > p2.first)
return true;
return p1.second < p2.second;
}

void findSolution()
{
int numElements;
cin >> numElements;
int k;
cin >> k;
read_array;
for (int i = 0; i < numElements; i++)
arr[i] %= k;
vector<int> ans;
for (int i = 0; i < numElements; i++)
if (arr[i] == 0)
ans.push_back(i + 1);
vector<pii> v(numElements);
for (int i = 0; i < numElements; i++)
v[i].first = arr[i], v[i].second = i + 1;
sort(v.begin(), v.end(), comparePair);
for (auto i : v)
if (i.first != 0)
ans.push_back(i.second);
for (int k : ans)
cout << k << ' ';
cout << endl;
}

signed main()
{
test_cases
findSolution();
return 0;
}
CF B
โค7๐Ÿ‘4