Geeksforgeeks
Quantitive Section
5/5 Answers✅
Quantitive Section
5/5 Answers✅
👍1
Geeksforgeeks
Logical Section
5/5 Answers✅
Logical Section
5/5 Answers✅
👍1
public int maxGoodLength(int matrix[][]){
int N = matrix.length;
int M = matrix[0].length;
int maxGoodLength = 0;
for (int L = Math.min(N, M); L > 0; L--) {
outerLoop:
for (int i = 0; i <= N - L; i++) {
for (int j = 0; j <= M - L; j++) {
boolean allGreater = true;
for (int x = i; x < i + L; x++) {
for (int y = j; y < j + L; y++) {
if (matrix[x][y] < L) {
allGreater = false;
break;
}
}
if (!allGreater) {
break;
}
}
if (allGreater) {
maxGoodLength = L;
break outerLoop;
}
}
}
if (maxGoodLength > 0) {
break;
}
}
return maxGoodLength;
}
@Coding_000✅
int N = matrix.length;
int M = matrix[0].length;
int maxGoodLength = 0;
for (int L = Math.min(N, M); L > 0; L--) {
outerLoop:
for (int i = 0; i <= N - L; i++) {
for (int j = 0; j <= M - L; j++) {
boolean allGreater = true;
for (int x = i; x < i + L; x++) {
for (int y = j; y < j + L; y++) {
if (matrix[x][y] < L) {
allGreater = false;
break;
}
}
if (!allGreater) {
break;
}
}
if (allGreater) {
maxGoodLength = L;
break outerLoop;
}
}
}
if (maxGoodLength > 0) {
break;
}
}
return maxGoodLength;
}
@Coding_000✅
🔥2❤1👍1
int minimumMagic(int n, int m, vector<int> &price, vector<int> &magical_price)
{
int sum=0,count=0;
for(int i=0;i<n;i++)
{
sum+=price[i];
}
if(sum<=m)
{
return 0;
}
vector<int> vec;
for(int i=0;i<n;i++)
{
vec.push_back(price[i]-magical_price[i]);
}
sort(vec.begin(),vec.end());
for(int i=n-1;i>=0;i--)
{
sum-=vec[i];
count++;
if(sum<=m)
{
return count;
}
}
return -1;
}
@Coding_000
{
int sum=0,count=0;
for(int i=0;i<n;i++)
{
sum+=price[i];
}
if(sum<=m)
{
return 0;
}
vector<int> vec;
for(int i=0;i<n;i++)
{
vec.push_back(price[i]-magical_price[i]);
}
sort(vec.begin(),vec.end());
for(int i=n-1;i>=0;i--)
{
sum-=vec[i];
count++;
if(sum<=m)
{
return count;
}
}
return -1;
}
@Coding_000
👍2🔥1🥰1
class Solution{
public:
bool isBeautifulString(const string& s) {
unordered_map<char, int> freq;
for (char c : s) {
freq[c]++;
}
int oddCount = 0;
for (const auto& p : freq) {
if (p.second % 2 != 0) {
oddCount++;
}
}
return oddCount <= 1;
}
long long noOfPairs(vector<string> &box)
{
int count = 0;
int n = box.size();
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++) {
string concatenated = box[i] + box[j];
if (isBeautifulString(concatenated)) {
count++;
}
}
}
return count;
}
};
@Coding_000✅
public:
bool isBeautifulString(const string& s) {
unordered_map<char, int> freq;
for (char c : s) {
freq[c]++;
}
int oddCount = 0;
for (const auto& p : freq) {
if (p.second % 2 != 0) {
oddCount++;
}
}
return oddCount <= 1;
}
long long noOfPairs(vector<string> &box)
{
int count = 0;
int n = box.size();
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++) {
string concatenated = box[i] + box[j];
if (isBeautifulString(concatenated)) {
count++;
}
}
}
return count;
}
};
@Coding_000✅
🔥4👍1
All 3 codes uploaded...😃😎
Share @Coding_000❤️👨💻
Share @Coding_000❤️👨💻
🔥2😎2
👍2😍2🔥1🤩1
👍2❤1
👍2
Company: WileyEdge
Role: Software Development
Batch: 2023, 2022
Apply Link: https://hire.wileyedge.examly.io/registration-form?form=Registration%20Form&eventId=k73ekjdixn&eventTitle=WE
Role: Software Development
Batch: 2023, 2022
Apply Link: https://hire.wileyedge.examly.io/registration-form?form=Registration%20Form&eventId=k73ekjdixn&eventTitle=WE
👍3
Code zinger
TECH MAHINDRA
Exam Help Available
Msg : @ILOVEU_143👨💻
Note: It's Paid 🤑🤑
Test Clearance Guaranteed ✅
TECH MAHINDRA
Exam Help Available
Msg : @ILOVEU_143👨💻
Note: It's Paid 🤑🤑
Test Clearance Guaranteed ✅
👍2
𝗔𝗻𝘆 𝗰𝗮𝗺𝗽𝘂𝘀 𝗽𝗹𝗮𝗰𝗲𝗺𝗲𝗻𝘁 𝗼𝗿 𝗢𝗳𝗳𝗰𝗮𝗺𝗽𝘂𝘀 𝗘𝘅𝗮𝗺.
𝗛𝗲𝗹𝗽 𝗮𝘃𝗮𝗶𝗹𝗮𝗯𝗹𝗲 𝗶𝗻 𝗔𝗹𝗹 𝗲𝘅𝗮𝗺𝘀✅.
𝗕𝗼𝗼𝗸 𝘆𝗼𝘂𝗿 𝘀𝗹𝗼𝘁.👨💻
𝗖𝗼𝗻𝘁𝗮𝗰𝘁 @ILOVEU_143 ❤️
𝗜𝘁𝘀 𝗽𝗮𝗶𝗱 ✅
𝟭𝟬𝟬% 𝗰𝗹𝗲𝗮𝗿𝗮𝗻𝗰𝗲 𝗴𝘂𝗮𝗿𝗮𝗻𝘁𝗲𝗲 🔥🔥
𝗦𝗵𝗮𝗿𝗲 @CODING_000👨💻
𝗛𝗲𝗹𝗽 𝗮𝘃𝗮𝗶𝗹𝗮𝗯𝗹𝗲 𝗶𝗻 𝗔𝗹𝗹 𝗲𝘅𝗮𝗺𝘀✅.
𝗕𝗼𝗼𝗸 𝘆𝗼𝘂𝗿 𝘀𝗹𝗼𝘁.👨💻
𝗖𝗼𝗻𝘁𝗮𝗰𝘁 @ILOVEU_143 ❤️
𝗜𝘁𝘀 𝗽𝗮𝗶𝗱 ✅
𝟭𝟬𝟬% 𝗰𝗹𝗲𝗮𝗿𝗮𝗻𝗰𝗲 𝗴𝘂𝗮𝗿𝗮𝗻𝘁𝗲𝗲 🔥🔥
𝗦𝗵𝗮𝗿𝗲 @CODING_000👨💻
👍3