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
Messages in this channel will be automatically deleted after 1 day
Messages in this channel will be automatically deleted after 1 month
Messages in this channel will no longer be automatically deleted
Uber today at 8pm ?
Anonymous Poll
67%
Yes
33%
No
👍31
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👍21
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