Goldman Sachs
Accenture On campus
Amazon -SDE
IBM
Oracle
All OA HELP AVAILABLE
DM OA @mrtrueliving_ix ✅
💯 Safe & Success rateAll placement help available
-@mrtrueliving_ix
-@mrtrueliving_ix
#include <vector>
#include <algorithm>
int getMinimumSeconds(std::vector<int>& fileSize) {
int n = fileSize.size();
std::vector<std::pair<int, int>> filesWithIndices(n);
for (int i = 0; i < n; ++i) {
filesWithIndices[i] = {fileSize[i], i};
}
// Sort by file size, then by original index to maintain stability
std::sort(filesWithIndices.begin(), filesWithIndices.end());
// Map original indices to their positions in the sorted array
std::vector<int> sortedIndex(n);
for (int i = 0; i < n; ++i) {
sortedIndex[filesWithIndices[i].second] = i;
}
int maxShift = 0;
for (int i = 0; i < n; ++i) {
int shift = i - sortedIndex[i];
if (shift > maxShift) {
maxShift = shift;
}
}
return maxShift;
}
int main() {
int n;
std::cin >> n;
std::vector<int> fileSize(n);
for (int i = 0; i < n; ++i) {
std::cin >> fileSize[i];
}
int result = getMinimumSeconds(fileSize);
std::cout << result << std::endl;
return 0;
}
Agoda intern✅
#include <cmath>
#include <cstdlib>
bool isValidTriangle(int x1, int y1, int x2, int y2, int x3, int y3);
double distance(int x1, int y1, int x2, int y2);
bool isPointInTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int xp, int yp);
double triangleArea(int x1, int y1, int x2, int y2, int x3, int y3);
int pointsBelong(int x1, int y1, int x2, int y2, int x3, int y3, int xp, int yp, int xq, int yq) {
if (!isValidTriangle(x1, y1, x2, y2, x3, y3)) {
return 0;
}
bool pBelongs = isPointInTriangle(x1, y1, x2, y2, x3, y3, xp, yp);
bool qBelongs = isPointInTriangle(x1, y1, x2, y2, x3, y3, xq, yq);
if (pBelongs && qBelongs) {
return 3;
} else if (pBelongs) {
return 1;
} else if (qBelongs) {
return 2;
} else {
return 4;
}
}
bool isValidTriangle(int x1, int y1, int x2, int y2, int x3, int y3) {
double ab = distance(x1, y1, x2, y2);
double bc = distance(x2, y2, x3, y3);
double ac = distance(x1, y1, x3, y3);
return (ab + bc > ac) && (bc + ac > ab) && (ac + ab > bc);
}
double distance(int x1, int y1, int x2, int y2) {
return std::sqrt(std::pow(x2 - x1, 2) + std::pow(y2 - y1, 2));
}
bool isPointInTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int xp, int yp) {
double areaABC = triangleArea(x1, y1, x2, y2, x3, y3);
double areaPAB = triangleArea(xp, yp, x1, y1, x2, y2);
double areaPAC = triangleArea(xp, yp, x1, y1, x3, y3);
double areaPBC = triangleArea(xp, yp, x2, y2, x3, y3);
return std::abs((areaPAB + areaPAC + areaPBC) - areaABC) < 1e-9;
}
double triangleArea(int x1, int y1, int x2, int y2, int x3, int y3) {
return std::abs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0;
}
Agoda ✅
#include <bits/stdc++.h>
long getTotalSteps(vector<int>& ht) {
long ans=0,cnt=0;
sort(ht.begin(),ht.end());
for(int i=0;i<ht.size();i++){
if(i<ht.size()-1&&ht[i]!=ht[i+1]){
cnt++;
ans+=cnt;
}
else if(i!=ht.size()-1) ans+=cnt;
}
return ans;
}
Agoda ✅
from sys import stdin
def main():
elements = stdin.read().strip().split()
n = len(elements)
bell_triangle = [[0] * (n + 1) for _ in range(n + 1)]
bell_triangle[0][0] = 1
for i in range(1, n + 1):
bell_triangle[i][0] = bell_triangle[i - 1][i - 1]
for j in range(1, i + 1):
bell_triangle[i][j] = bell_triangle[i - 1][j - 1] + bell_triangle[i][j - 1]
print(bell_triangle[n][0] - 1)
if __name__ == "__main__":
main()
Set partitioning ✅
❤1
Accenture on campus help available
💯 Test Clearance 👌
@mrtrueliving_ix ✅
https://t.me/code_alphix/3651
💯 Test Clearance 👌
@mrtrueliving_ix ✅
https://t.me/code_alphix/3651
All placement help available
DM for help @mrtrueliving_ix✅
💯 Test Clearance 🤗 with remote access safe & secure 🔐
DM for help @mrtrueliving_ix✅
💯 Test Clearance 🤗 with remote access safe & secure 🔐
Any kind of OA help available:
0️⃣ Oracle
0️⃣ Flipkart
0️⃣ UBS
0️⃣ Infosys-SP
0️⃣ Meesho
0️⃣ Phone pe
0️⃣ UBER
0️⃣ Accenture
0️⃣ Congizant
0️⃣ IBM
0️⃣ Mountblue
0️⃣ CAPGEMINI
0️⃣ Mitsogo
0️⃣ Lam research
On / Off campus placement
💯 Test Clearance ✔️
Don't miss the opportunity 📌
DM for OA:
@Mrtrueliving_ix
@Mrtrueliving_ix
@Mrtrueliving_ix
0️⃣ Oracle
0️⃣ Flipkart
0️⃣ UBS
0️⃣ Infosys-SP
0️⃣ Meesho
0️⃣ Phone pe
0️⃣ UBER
0️⃣ Accenture
0️⃣ Congizant
0️⃣ IBM
0️⃣ Mountblue
0️⃣ CAPGEMINI
0️⃣ Mitsogo
0️⃣ Lam research
On / Off campus placement
💯 Test Clearance ✔️
Don't miss the opportunity 📌
DM for OA:
@Mrtrueliving_ix
@Mrtrueliving_ix
@Mrtrueliving_ix
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
/*
* Complete the 'minTimeForRobots' function below.
*
* The function is expected to return a LONG_INTEGER.
* The function accepts following parameters:
* 1. INTEGER the_number_of_robots
* 2. INTEGER_ARRAY rack_capacities
*/
#include<bits/stdc++.h>
using ll = long long;
using namespace std;
bool canAllocate(const vector<int>& capacities, ll k, ll maxLoad) {
ll robotCount = 1;
ll currentLoad = 0;
for (int cap : capacities) {
if (cap > maxLoad) return false;
if (currentLoad + cap > maxLoad) {
robotCount++;
currentLoad = cap;
if (robotCount > k) return false;
} else {
currentLoad += cap;
}
}
return true;
}
long long minTimeForRobots(int the_number_of_robots, std::vector<int> rack_capacities) {
ll n = rack_capacities.size();
if (the_number_of_robots == 0) return -1;
if(the_number_of_robots>n)return *max_element(rack_capacities.begin(), rack_capacities.end());
ll low = *max_element(rack_capacities.begin(), rack_capacities.end());
ll high = accumulate(rack_capacities.begin(), rack_capacities.end(), 0l);
ll result = high;
while (low <= high) {
ll mid = low + (high - low) / 2;
if (canAllocate(rack_capacities, the_number_of_robots, mid)) {
result = mid;
high = mid - 1;
} else {
low = mid + 1;
}
}
return result;
}
Accenture ON campus placement ✅
All MCQ & coding are done ✅
Round 1 & Round 2 cleared 💯
All placement help available
DM FOR OA HELP: @mrtrueliving_ix // @mrtrueliving_ix
#Accenture #ONCAMPUS #RemoteAccess ✅
All MCQ & coding are done ✅
Round 1 & Round 2 cleared 💯
All placement help available
DM FOR OA HELP: @mrtrueliving_ix // @mrtrueliving_ix
#Accenture #ONCAMPUS #RemoteAccess ✅