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 today at 8pm ?
Anonymous Poll
67%
Yes
33%
No
๐Ÿ‘3โšก1
vector<long long> solution(int t, vector<vector<long long>> carPrices) {
vector<long long> ans;
for (int i = 0; i < t; i++) {
vector<long long> arr = carPrices[i];
long long result = 0;
long long maxDiff = INT_MIN;
int N = arr.size();
for (int j = 0; j < N; j++) {
long long current = arr[j];
maxDiff = max(maxDiff, current);
result = max(result, maxDiff - current);
}
long long res = 0;
while ((1LL << res) - 1 < result) {
++res;
}
cout << res << endl;
ans.push_back(res);
}
return ans;
}
UBER CAR working
โค5๐Ÿ‘3
bool fun(vector<int>& arr) {
int sum = 0;
for (int num : arr) {
sum += num;
}
int average = round(sum / arr.size());
for (int num : arr) {
if (num == average) {
return true;
}
}
return false;
}
allen
โค5๐Ÿ‘3
def check_average_in_array(arr):
average = round(sum(arr) / len(arr))
return average in arr
python code for 1st
๐Ÿ‘4
int calculateShortestPath(int numStops, vector<int> credits, int numRoads, vector<vector<int>> roads, int source, int dest)
{
vector<vector<pair<int, int>>> adjacencyList(numStops);
for (int i = 0; i < numRoads; i++) {
int u = roads[i][0];
int v = roads[i][1];
int weight = roads[i][2];
adjacencyList[u].push_back({v, weight});
adjacencyList[v].push_back({u, weight});
}
vector<int> distances(1e6 + 5, 0x3f3f3f3f);
priority_queue<pair<int, int>> pq;
int initialNode = credits[source] * numStops + source;
pq.push({0, initialNode});
distances[initialNode] = 0;
while (!pq.empty()) {
auto currentPair = pq.top();
int currentDistance = currentPair.first;
int currentNode = currentPair.second;
int currentCredit = currentNode / numStops;
int currentVertex = currentNode % numStops;
pq.pop();
if (currentVertex == dest) {
return -currentDistance;
}
for (auto neighbor : adjacencyList[currentVertex]) {
int neighborVertex = neighbor.first;
int weight = neighbor.second;
if (weight > currentCredit) continue;
int newCredit = currentCredit - weight + credits[neighborVertex];
int newScore = newCredit * numStops + neighborVertex;
if (newCredit > 1e4) continue;
if (distances[newScore] > distances[currentNode] + weight) {
distances[newScore] = distances[currentNode] + weight;
pq.push({-(distances[currentNode] + weight), newScore});
}
}
}
return -1;
}
3rd working all verified
๐Ÿ”ฅ5๐Ÿ‘2โค1
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