Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO
3.37K subscribers
1.13K photos
3 videos
17 files
373 links
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
Download Telegram
Wipro milestone 1 2 & 3
All solutions available

Mcq and coding..👨‍💻

Dm fast @ILOVEU_143
Share @coding_000❤️
👍2
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
🔥21👍1