Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO
الذهاب إلى القناة على Telegram
Main channel https://t.me/Coding_000 Contact Admin 👉 @ILOVEU_143 for booking your exam slots Web- https://coding000.github.io/Projects/ 💯% clearance in any placement exams OffCampus -https://t.me/Offcampus_000 Discussion- https://t.me/exams_discussion
إظهار المزيد3 367
المشتركون
-124 ساعات
-127 أيام
-4630 أيام
أرشيف المشاركات
#include <iostream>
#include <map>
#include <cmath>
using namespace std;
#define MOD 998244353
map<long long, long long> frequencyMap;
long long fastExponentiation(long long base, long long exponent) {
long long result = 1;
base = base % MOD;
while (exponent) {
if (exponent % 2)
result = (result * base) % MOD;
base = (base * base) % MOD;
exponent >>= 1;
}
return result;
}
int main() {
long long n, inputValue, isAllZeros = 1, maxInputValue = 0;
long long answer = 1;
cin >> n;
for (long long i = 0; i < n; i++) {
cin >> inputValue;
frequencyMap[inputValue]++;
maxInputValue = max(maxInputValue, inputValue);
if ((i == 0 && inputValue != 0) || (i != 0 && inputValue == 0))
isAllZeros = 0;
}
if (isAllZeros) {
for (long long i = 1; i <= maxInputValue; i++) {
answer = (answer % MOD * fastExponentiation(frequencyMap[i - 1], frequencyMap[i]) % MOD) % MOD;
}
cout << answer % MOD << endl;
} else {
cout << 0 << endl;
}
return 0;
}
"TREE" AMAZON HACKON OA ROUND 2 CODE
VERIFIED 🥰
Share @coding_000❤️✅
#include <iostream>
#include <vector>
#include <unordered_map> // Include the unordered_map header
using namespace std;
int findMaxSum(int n, int elements[], int k) {
// Adjust elements to make them odd
for (int i = 0; i < n; i++) {
if (elements[i] % 2 == 0) {
elements[i] = elements[i] - 1;
}
}
unordered_map<int, int> elementFrequency;
int currentSum = 0, maxSum = 0;
int left = 0, right = 0;
// Calculate the initial sum and frequency
while (right < k && right < n) {
currentSum += elements[right];
elementFrequency[elements[right]]++;
right++;
}
if (elementFrequency.size() == k) {
maxSum = currentSum;
}
// Sliding window technique
while (right < n) {
elementFrequency[elements[right]]++;
elementFrequency[elements[left]]--;
if (elementFrequency[elements[left]] == 0) {
elementFrequency.erase(elements[left]);
}
currentSum += elements[right];
currentSum -= elements[left];
if (elementFrequency.size() == k) {
maxSum = max(maxSum, currentSum);
}
left++;
right++;
}
return maxSum;
}
int main() {
int n;
cin >> n;
int elements[n];
for (int i = 0; i < n; i++) {
cin >> elements[i];
}
int k;
cin >> k;
int result = findMaxSum(n, elements, k);
cout << result << endl;
return 0;
}
"MINIMUM COST(VECTOR)" AMAZON HACKON OA ROUND 2 CODE
VERIFIED 🥰
Share @coding_000❤️
Guys share our channel ✅✅✅
@Coding_000❤️
Amazon Hackon Codes Uploaded 👆👆
#include <iostream>
#include <vector>
#include <unordered_map> // Include the unordered_map header
using namespace std;
int solve(int n, int arr[], int k) { // Change the array parameter declaration
for (int i = 0; i < n; i++) {
if (arr[i] % 2 == 0) {
arr[i] = arr[i] - 1;
}
}
unordered_map<int, int> mp;
int currentSum = 0, maxSum = 0;
int left = 0, i = 0;
while (i < k && i < n) {
currentSum += arr[i];
mp[arr[i]]++;
i++;
}
if (mp.size() == k) {
maxSum = currentSum;
}
for (int i = k; i < n; i++) {
mp[arr[i]]++;
mp[arr[left]]--;
if (mp[arr[left]] == 0) {
mp.erase(arr[left]);
}
currentSum += arr[i];
currentSum -= arr[left];
if (mp.size() == k) {
maxSum = max(maxSum, currentSum);
}
left++;
}
return maxSum;
}
int main() {
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int k;
cin >> k;
int ans = solve(n, arr, k); // Pass the array correctly
cout << ans << endl;
return 0;
}
" MAXSUM " AMAZON HACKON OA ROUND 2 CODE
VERIFIED 🥰
AnimatedSticker.tgs0.02 KB
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct Mouse {
int row, col, time;
Mouse(int r, int c, int t) : row(r), col(c), time(t) {}
};
int countRemainingCheese(vector<vector<int>>& grid) {
int count = 0;
for (const auto& row : grid) {
for (int cell : row) {
if (cell == 1) {
count++;
}
}
}
return count;
}
int findMinimumTimeToEatCheese(int N, vector<vector<int>>& grid) {
vector<vector<int>> directions = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
vector<vector<bool>> visited(N, vector<bool>(N, false));
queue<Mouse> q;
// Find the mouse's initial position
int mouseRow = 0, mouseCol = 0;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (grid[i][j] == 2) {
mouseRow = i;
mouseCol = j;
}
}
}
q.push(Mouse(mouseRow, mouseCol, 0));
visited[mouseRow][mouseCol] = true;
int cheeseEaten = 0;
int minTime = 0;
while (!q.empty()) {
Mouse currentMouse = q.front();
q.pop();
for (const auto& direction : directions) {
int newRow = currentMouse.row + direction[0];
int newCol = currentMouse.col + direction[1];
if (newRow >= 0 && newRow < N && newCol >= 0 && newCol < N && !visited[newRow][newCol]) {
if (grid[newRow][newCol] == 1) {
cheeseEaten++;
minTime = currentMouse.time + 1;
if (cheeseEaten == countRemainingCheese(grid)) {
return minTime;
}
}
if (grid[newRow][newCol] != 0) {
visited[newRow][newCol] = true;
q.push(Mouse(newRow, newCol, currentMouse.time + 1));
}
}
}
}
return -1; // If all cheese cannot be eaten
}
int main() {
int N;
cin >> N;
vector<vector<int>> grid(N, vector<int>(N));
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
cin >> grid[i][j];
}
}
int minimumTime = findMinimumTimeToEatCheese(N, grid);
cout << minimumTime << endl;
return 0;
}
"CHEESE" AMAZON HACKON OA ROUND 2 CODE
VERIFIED 🥰
VERIFIED
#include <iostream>
#include <vector>
using namespace std;
int countWaysToDivideGarden(int N, vector<int>& mangoes) {
int totalWays = 0;
vector<int> cumulativeSum(N, 0);
// Calculate the cumulative sum of mangoes from left to right
cumulativeSum[0] = mangoes[0];
for (int i = 1; i < N; ++i) {
cumulativeSum[i] = cumulativeSum[i - 1] + mangoes[i];
}
// Iterate through possible split points
for (int splitIdx = 1; splitIdx < N - 1; ++splitIdx) {
int sumLeft = cumulativeSum[splitIdx];
int sumRight = cumulativeSum[N - 1] - cumulativeSum[splitIdx];
// Check if sumLeft + sumRight > sumCenter
if (sumLeft + sumRight > cumulativeSum[splitIdx]) {
totalWays++;
}
}
return totalWays;
}
int main() {
int numTestCases;
cin >> numTestCases;
while (numTestCases--) {
int numMangoes;
cin >> numMangoes;
vector<int> mangoWeights(numMangoes);
for (int i = 0; i < numMangoes; ++i) {
cin >> mangoWeights[i];
}
int waysToDivide = countWaysToDivideGarden(numMangoes, mangoWeights);
cout << waysToDivide << endl;
}
return 0;
}
"GARDEN" AMAZON HACKON OA ROUND 2 CODE
VERIFIED
#include <iostream>
#include <string>
bool isVowel(char c) {
const std::string vowels = "aeiouAEIOU";
return vowels.find(c) != std::string::npos;
}
std::string addDollarAfterVowels(const std::string& input) {
std::string modifiedString;
bool consecutiveVowels = false;
for (size_t i = 0; i < input.length(); i++) {
modifiedString += input[i];
if (isVowel(input[i])) {
if (consecutiveVowels) {
modifiedString += '$';
consecutiveVowels = false; // Reset the flag
} else {
consecutiveVowels = true;
}
} else {
consecutiveVowels = false;
}
}
return modifiedString;
}
int main() {
std::string input = "aabbeedpee";
std::string result = addDollarAfterVowels(input);
std::cout << result << std::endl;
return 0;
}
$ SIGN AMAZON HACKON OA ROUND 2 CODE
VERIFIED
Done very well with our student's Amazon exam 😇
All MCQs on time with nearly 100% accuracy ✨
If you too need help with any placement tests, Feel free to DM us at @ILOVEU_143✅
Best wishes always ✨❤️
𝐀𝐭𝐭𝐞𝐧𝐭𝐢𝐨𝐧 𝐆𝐮𝐲𝐬 ⚠️⚠️
𝐃𝐨𝐧'𝐭 𝐌𝐢𝐬𝐬 𝐲𝐨𝐮𝐫 𝐨𝐩𝐩𝐨𝐫𝐭𝐮𝐧𝐢𝐭𝐲 𝐟𝐨𝐫 𝐞𝐱𝐚𝐦𝐬 𝐃𝐮𝐞 𝐭𝐨 𝐫𝐞𝐜𝐞𝐬𝐬𝐢𝐨𝐧 𝐥𝐞𝐬𝐬 𝐜𝐨𝐦𝐩𝐚𝐧𝐢𝐞𝐬 𝐚𝐫𝐞 𝐡𝐢𝐫𝐢𝐧𝐠 𝐒𝐨 𝐭𝐚𝐤𝐞 𝐞𝐯𝐞𝐫𝐲 𝐞𝐱𝐚𝐦 𝐚𝐬 𝐬𝐞𝐫𝐢𝐨𝐮𝐬 𝐖𝐞 𝐩𝐫𝐨𝐯𝐢𝐝𝐞 𝐜𝐨𝐦𝐩𝐥𝐞𝐭𝐞 𝐞𝐱𝐚𝐦 𝐡𝐞𝐥𝐩 𝐰𝐢𝐭𝐡 𝐩𝐫𝐨𝐩𝐞𝐫 𝐰𝐨𝐫𝐤𝐢𝐧𝐠 𝐜𝐨𝐝𝐞𝐬.
𝐅𝐨𝐫 𝐞𝐱𝐚𝐦 𝐡𝐞𝐥𝐩 𝐚𝐧𝐝 𝐜𝐨𝐝𝐞𝐬:
@ILOVEU_143✅
@ILOVEU_143👨💻
𝗕𝗼𝗼𝗸 𝘆𝗼𝘂𝗿 𝘀𝗹𝗼𝘁.
𝗜𝘁𝘀 𝗽𝗮𝗶𝗱 ✅
𝟭𝟬𝟬% 𝗰𝗹𝗲𝗮𝗿𝗮𝗻𝗰𝗲 𝗴𝘂𝗮𝗿𝗮𝗻𝘁𝗲𝗲 🔥🔥
𝗦𝗵𝗮𝗿𝗲 @Coding_000❤️✅
Guys please share this channel to all ur Frd’s nd Juniors❤️
https://t.me/Coding_000
Mitsogo Recruitment 2023 | Mitsogo technologies recruitment process 2023
https://www.mitsogo.com/career/software-engineer-fresher-hiring/
Cognizant CSD✅
Foundation skill readiness
Pattern :
3 java coding questions
2 sql queries
12 mcqs
How many are writing this exam..Hit like button 👍👍❤️
Share our channel @Coding_000❤️✅
int countChar(string data, char coder) {
int count = 0;
for (int i = 0; i < data.length(); i++) {
if (data[i] == coder) {
count++;
}
}
return count;
}
Share @Coding_000❤️
Foundation skill readiness
Pattern :
3 java coding questions
2 sql queries
12 mcqs
leetcode Interview questions .pdf
Concentrix exam
Those who need help for Concentrix
CONTACT @ILOVEU_143✅
May the Lord bless you with lots of good luck and prosperity.
Happy Ganesh Chaturthi to you and your family ❤️
All the best ur upcoming jobs ❤️
@Coding_000
Assignment Help
Hello everyone, 😃
If anyone need assignment help in Data Science, Computer Science, Information Science, Business analytics and Advance data analytics
Please let me know , I’ll guarantee that you will get best scores
Join this channel
https://t.me/assignment_project_usa
https://t.me/assignment_project_usa
https://t.me/assignment_project_usa
متاح الآن! بحث تيليغرام 2025 — أهم رؤى العام 
