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
decryptmessage

Guys plagiarism will be checked so please change method order and variable name 

Share @Coding_000❤️
1🔥1
🔥To Apply  For Latest Jobs and Internships and Offcampus links

🙋 Please Check
👇

https://t.me/Offcampus_000
1👍1
👉 VIRTUSA

Exam Help Available
Note: It's Paid 💰💰

Msg: @ILOVEU_143

Test Clearance Guaranteed👨‍💻

Share @Coding_000 ❤️😊
👍2🔥1
Capgemini pip exam help available

Exam Help Available
Note: It's Paid 💰💰

Msg: @ILOVEU_143

Test Clearance Guaranteed👨‍💻

Share @Coding_000 ❤️😊
👍2
Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO
Photo
public class StringSwap {
    public static String performOperations(String initialString, int numOperations, int[] operationsArray) {
        StringBuilder currentString = new StringBuilder(initialString);

        for (int operation : operationsArray) {
            if (operation == 1) {
               
                char temp = currentString.charAt(0);
                currentString.setCharAt(0, currentString.charAt(currentString.length() - 1));
                currentString.setCharAt(currentString.length() - 1, temp);
            } else if (operation == 2) {
               
                int middle = currentString.length() / 2;
                String firstHalf = currentString.substring(0, middle);
                String secondHalf = currentString.substring(middle);
                currentString = new StringBuilder(secondHalf + firstHalf);
            }
        }

        return currentString.toString();
    }

    public static void main(String[] args) {
        String initialString = "ABCD";
        int numOperations = 2;
        int[] operationsArray = {1, 2, 1};

        String result = performOperations(initialString, numOperations, operationsArray);
        System.out.println(result);
    }
}


Virtusa in java🆓

Share @Coding_000❤️
🔥1🥰1
import java.util.Arrays;

public class MaxScore {
    public static int findMaxScore(int N, int[] A) {
        Arrays.sort(A);
        int score = 0;

        for (int i = 0; i < N - 1; i += 2) {
            score += Math.abs(A[i] - A[i + 1]);
        }

        return score;
    }

    public static void main(String[] args) {
        int N = 5;
        int[] A = {10, 5, 1, 8, 4};

        int result = findMaxScore(N, A);
        System.out.println(result);
    }
}

Share @Coding_000❤️
1👍1🔥1
public class PrefixSuffixBalance {
    public static int[] calculatePrefixSuffixBalance(int N, int[] A) {
        int[] result = new int[N];

        for (int i = 0; i < N; i++) {
            int sumFirstPart = 0;
            int sumSecondPart = 0;

           
            for (int j = 0; j <= i; j++) {
                sumFirstPart += A[j];
            }

           
            for (int k = i + 1; k < N; k++) {
                sumSecondPart += A[k];
            }

          
            result[i] = Math.abs(sumFirstPart - sumSecondPart);
        }

        return result;
    }

    public static void main(String[] args) {
        int N = 5;
        int[] A = {11, 2, 3, 4, 5};

        int[] result = calculatePrefixSuffixBalance(N, A);

       
        for (int value : result) {
            System.out.print(value + " ");
        }
    }
}

Share @coding_000👨‍💻
Virtusa Exam ❤️
🔥1🥰1
import java.util.Arrays;

public class SurpriseDebate {
    public static int findLowestRollNumber(int N, int[] A, int K) {
        Arrays.sort(A);
        int lowestRollNumber = -1;

        for (int i = 0, j = N - 1; i < j; i++, j--) {
            int sum = A[i] + A[j];
            if (sum % K == 0) {
                lowestRollNumber = Math.min(A[i], A[j]);
            } else {
               
                break;
            }
        }

       
        if (lowestRollNumber == -1 && N % 2 == 1 && A[N / 2] * 2 % K == 0) {
            lowestRollNumber = A[N / 2];
        }

        return lowestRollNumber;
    }

    public static void main(String[] args) {
        int N = 5;
        int[] A = {12, 1, 3, 5, 44};
        int K = 6;

        int result = findLowestRollNumber(N, A, K);
        System.out.println(result);
    }
}

Share @Coding_000❤️
🔥21