Feedback about OneIT โค๏ธ
Join our Page more upcoming updates โค๏ธ
https://t.me/code_alphix
I need your support ๐
โ๏ธminiOrange strictly follows paligariam.there is high chance ?โโ
3 codes โ - 90 min timing
Don't depend free codes...
If you decide write โ๏ธ free codes...
Make sure write plag free codes only ..
All the best from our page ๐
3 codes โ - 90 min timing
COGNIZANT EXAM HELP GROUP pinned ยซminiOrange 12.00 pm slot available Ping me who want Help #paid help โค๏ธยป
COGNIZANT EXAM HELP GROUP
Photo
#include <iostream>
#include <vector>
using namespace std;
int giveChocolates(vector<int>& childrenRatings) {
int n = childrenRatings.size();
vector<int> ch(n, 1);
for (int i = 1; i < n; ++i) {
if (childrenRatings[i] > childrenRatings[i - 1]) {
ch[i] = ch[i - 1] + 1;
}
}
for (int i = n - 2; i >= 0; --i) {
if (childrenRatings[i] > childrenRatings[i + 1]) {
ch[i] = max(ch[i], ch[i + 1] + 1);
}
}
int sumChocolates = 0;
for (int chocolates : ch) {
sumChocolates += chocolates;
}
return sumChocolates;
}
int main() {
vector<int> ratings = {1, 3, 4, 3, 2, 1};
cout << "Total chocolates: " << giveChocolates(ratings) << endl;
return 0;
}
Chocolate -cppโ ๐ฏ
#include <vector>
using namespace std;
int giveChocolates(vector<int>& childrenRatings) {
int n = childrenRatings.size();
vector<int> ch(n, 1);
for (int i = 1; i < n; ++i) {
if (childrenRatings[i] > childrenRatings[i - 1]) {
ch[i] = ch[i - 1] + 1;
}
}
for (int i = n - 2; i >= 0; --i) {
if (childrenRatings[i] > childrenRatings[i + 1]) {
ch[i] = max(ch[i], ch[i + 1] + 1);
}
}
int sumChocolates = 0;
for (int chocolates : ch) {
sumChocolates += chocolates;
}
return sumChocolates;
}
int main() {
vector<int> ratings = {1, 3, 4, 3, 2, 1};
cout << "Total chocolates: " << giveChocolates(ratings) << endl;
return 0;
}
Chocolate -cppโ ๐ฏ
def largestComponent(pcbGrid):
if not pcbGrid:
return 0
m = len(pcbGrid)
n = len(pcbGrid[0])
max_size = 0
def codealpha(i, j):
if i < 0 or i >= m or j < 0 or j >= n or pcbGrid[i][j] == 0:
return 0
size = 1
size += codealpha(i+1, j)
size += codealpha(i-1, j)
size += codealpha(i, j+1)
size += codealpha(i, j-1)
size += codealpha(i+1, j+1)
size += codealpha(i+1, j-1)
size += codealpha(i-1, j+1)
size += codealpha(i-1, j-1)
return size
for i in range(m):
for j in range(n):
if pcbGrid[i][j] == 1:
component_size = codealpha(i, j)
max_size = max(max_size, component_size)
return max_size
if not pcbGrid:
return 0
m = len(pcbGrid)
n = len(pcbGrid[0])
max_size = 0
def codealpha(i, j):
if i < 0 or i >= m or j < 0 or j >= n or pcbGrid[i][j] == 0:
return 0
size = 1
size += codealpha(i+1, j)
size += codealpha(i-1, j)
size += codealpha(i, j+1)
size += codealpha(i, j-1)
size += codealpha(i+1, j+1)
size += codealpha(i+1, j-1)
size += codealpha(i-1, j+1)
size += codealpha(i-1, j-1)
return size
for i in range(m):
for j in range(n):
if pcbGrid[i][j] == 1:
component_size = codealpha(i, j)
max_size = max(max_size, component_size)
return max_size
10/10 miniOrange ๐ฏ
COGNIZANT EXAM HELP GROUP
https://docs.google.com/forms/d/e/1FAIpQLScYrwrHDEEa5j3hffk367zMkfQnNKXaApi3AyhyccZ_VFwJCg/viewform Q Minds
Check your mails....โค๏ธ๐ฏ
All the best dear members
DM for you needs help
๐๐๐ค
Accenture 12th 10am slot
Test accomplished โค๏ธ๐ค
90/90 MCQ s // 2/2 coding ๐
#pic sharing
DM for any kind of OA
@Mrtrueliving_ix
@Mrtrueliving_ix
Mini orange ๐
Role : software Engineer ๐โ๏ธ
Test accomplished โค๏ธ
DM for any kind of OA
Accenture 7pm slot available โค๏ธ
๐ฅ๐ฅ๐ฅ
@Mrtrueliving_ix
@Mrtrueliving_ix
@Mrtrueliving_ix