main a3795782cfee cached
99 files
83.1 KB
25.9k tokens
229 symbols
1 requests
Download .txt
Repository: Aditya-Mishra19/TCS-NQT-2024-Coding-Solutions
Branch: main
Commit: a3795782cfee
Files: 99
Total size: 83.1 KB

Directory structure:
gitextract_1jnw95xb/

├── .vscode/
│   └── settings.json
├── 06 MAY SHIFT 1/
│   ├── MAJORITY ELEMENT/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── SORT NUMBERS/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 06 MAY SHIFT 2/
│   ├── Missing number/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── Prime number/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 08 MAY SHIFT 2/
│   ├── SequenceQuestion/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── fiveThree Program/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 09 MAY 2024 SHIFT - 1/
│   ├── Armstrong Number/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── print top K students/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 14 May Shift 1/
│   ├── Maximum Sum of Subarray/
│   │   ├── codeCpp.cpp
│   │   ├── codeJava.java
│   │   └── codePy.py
│   └── Sum of unique elements/
│       ├── codeCpp.cpp
│       ├── codeJava.java
│       └── codePy.py
├── 14 May Shift 2/
│   ├── Cost of shipping/
│   │   ├── codeCpp.cpp
│   │   ├── codeJava.java
│   │   └── codePy.py
│   └── Number of Subarray of sum of K/
│       ├── codeCpp.cpp
│       ├── codeJava.java
│       └── codePy.py
├── 26 APRIL 2024 SHIFT - 1/
│   ├── Find subarray equals to target/
│   │   ├── codeCpp.cpp
│   │   ├── codeJava.java
│   │   └── subArraySum.py
│   └── Unique Paths/
│       ├── codeCpp.cpp
│       ├── codeJava.java
│       └── uniquePaths.py
├── 26 APRIL 2024 SHIFT - 2/
│   ├── Cube sum/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── cubeSum.py
│   └── Find Most sell item-avg-totalsell/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 29 APRIL 2024 Shift - 1/
│   ├── Maximum element of subarray/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   ├── code.py
│   │   └── tempCodeRunnerFile.py
│   └── Multiplication table/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 29 APRIL SHIFT 2/
│   ├── Bit OR Sum/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── FIbonacci/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 3 May SHIFT 2/
│   ├── Maximum Efficiency/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── Pairs of shoes/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 3 May Shift 1/
│   ├── Number Divisible/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── maximum difference between smallest and largest/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 30 APRIL SHIFT 1/
│   ├── GRADE Problem/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   ├── code.py
│   │   └── tempCodeRunnerFile.py
│   └── MAJORITY ELEMENT/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 8 MAY SHIFT 1/
│   ├── Nearest divisible/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── Password creations/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 9 May 2024 Shift - 2/
│   ├── Print All combinations/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── Sort the given array asc and desc/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
└── TCS NQT ALL INPUT scenario/
    ├── Arrays 1D/
    │   ├── code.cpp
    │   ├── code.java
    │   └── code.py
    └── Strings/
        ├── code.cpp
        ├── code.java
        └── code.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .vscode/settings.json
================================================
{
    "files.associations": {
        "ostream": "cpp",
        "array": "cpp",
        "atomic": "cpp",
        "*.tcc": "cpp",
        "bitset": "cpp",
        "cctype": "cpp",
        "cfenv": "cpp",
        "charconv": "cpp",
        "chrono": "cpp",
        "cinttypes": "cpp",
        "clocale": "cpp",
        "cmath": "cpp",
        "codecvt": "cpp",
        "complex": "cpp",
        "condition_variable": "cpp",
        "csetjmp": "cpp",
        "csignal": "cpp",
        "cstdarg": "cpp",
        "cstddef": "cpp",
        "cstdint": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "cstring": "cpp",
        "ctime": "cpp",
        "cuchar": "cpp",
        "cwchar": "cpp",
        "cwctype": "cpp",
        "deque": "cpp",
        "forward_list": "cpp",
        "list": "cpp",
        "unordered_map": "cpp",
        "unordered_set": "cpp",
        "vector": "cpp",
        "exception": "cpp",
        "algorithm": "cpp",
        "functional": "cpp",
        "iterator": "cpp",
        "map": "cpp",
        "memory": "cpp",
        "memory_resource": "cpp",
        "numeric": "cpp",
        "optional": "cpp",
        "random": "cpp",
        "ratio": "cpp",
        "regex": "cpp",
        "set": "cpp",
        "string": "cpp",
        "string_view": "cpp",
        "system_error": "cpp",
        "tuple": "cpp",
        "type_traits": "cpp",
        "utility": "cpp",
        "fstream": "cpp",
        "future": "cpp",
        "initializer_list": "cpp",
        "iomanip": "cpp",
        "iosfwd": "cpp",
        "iostream": "cpp",
        "istream": "cpp",
        "limits": "cpp",
        "mutex": "cpp",
        "new": "cpp",
        "scoped_allocator": "cpp",
        "shared_mutex": "cpp",
        "sstream": "cpp",
        "stdexcept": "cpp",
        "streambuf": "cpp",
        "thread": "cpp",
        "typeindex": "cpp",
        "typeinfo": "cpp",
        "valarray": "cpp"
    }
}

================================================
FILE: 06 MAY SHIFT 1/MAJORITY ELEMENT/code.cpp
================================================
#include <iostream>
#include <unordered_map>
#include <vector>
#include <sstream>

using namespace std;

void findMajorityElement(vector<string>& arr, int N) {
    unordered_map<string, int> freq;
    for (string& n : arr) {
        if (freq.find(n) != freq.end()) {
            freq[n]++;
        } else {
            freq[n] = 1;
        }
    }
    for (auto& it : freq) {
        if (it.second >= N / 3) {
            cout << it.first << " ";
        }
    }
}

void findMajorityElementInt(vector<int>& arr, int N) {
    unordered_map<int, int> freq;
    for (int& num : arr) {
        if (freq.find(num) != freq.end()) {
            freq[num]++;
        } else {
            freq[num] = 1;
        }
    }
    for (auto& it : freq) {
        if (it.second >= N / 3) {
            cout << it.first << " ";
        }
    }
}

void input_array_format() {
    cout << "\nEnter elements in format [e1,e2,e3]: ";
    string input;
    getline(cin, input);
    stringstream ss(input);
    string token;
    vector<string> arr;
    while (getline(ss, token, ',')) {
        arr.push_back(token);
    }
    findMajorityElement(arr, arr.size());
}

void input_space_separated() {
    cout << "\nCase 2: Enter space-separated elements: ";
    string input;
    getline(cin, input);
    stringstream ss(input);
    int num;
    vector<int> arr;
    while (ss >> num) {
        arr.push_back(num);
    }
    findMajorityElementInt(arr, arr.size());
}

int main() {
    input_array_format();
    input_space_separated();
    return 0;
}


================================================
FILE: 06 MAY SHIFT 1/MAJORITY ELEMENT/code.java
================================================
import java.util.HashMap;
import java.util.Scanner;

public class MajorityElement {

    public static void findMajorityElement(String[] arr, int N) {
        HashMap<String, Integer> freq = new HashMap<>();
        for (String n : arr) {
            if (freq.containsKey(n)) {
                freq.put(n, freq.get(n) + 1);
            } else {
                freq.put(n, 1);
            }
        }
        for (String key : freq.keySet()) {
            if (freq.get(key) >= N / 3) {
                System.out.print(key + " ");
            }
        }
    }

    public static void findMajorityElementInt(int[] arr, int N) {
        HashMap<Integer, Integer> freq = new HashMap<>();
        for (int num : arr) {
            if (freq.containsKey(num)) {
                freq.put(num, freq.get(num) + 1);
            } else {
                freq.put(num, 1);
            }
        }
        for (int key : freq.keySet()) {
            if (freq.get(key) >= N / 3) {
                System.out.print(key + " ");
            }
        }
    }

    public static void inputArrayFormat() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("\nEnter elements in format [e1,e2,e3]: ");
        String input = scanner.nextLine().replaceAll("[\\[\\]]", "");
        String[] arr = input.split(",");
        findMajorityElement(arr, arr.length);
    }

    public static void inputSpaceSeparated() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("\nCase 2: Enter space-separated elements: ");
        String input = scanner.nextLine();
        String[] strArr = input.split("\\s+");
        int[] arr = new int[strArr.length];
        for (int i = 0; i < strArr.length; i++) {
            arr[i] = Integer.parseInt(strArr[i]);
        }
        findMajorityElementInt(arr, arr.length);
    }

    public static void main(String[] args) {
        inputArrayFormat();
        inputSpaceSeparated();
    }
}


================================================
FILE: 06 MAY SHIFT 1/MAJORITY ELEMENT/code.py
================================================
def findMajorityElement(arr, N):
    freq = {}
    for n in arr:
        num = int(n)
        if num in freq:
            freq[num] += 1 
        else:
            freq[num] = 1
    for key, val in freq.items():
        if val >= N // 3:
            print(key, end=" ")


def findMajorityElementInt(arr, N):
    freq = {}
    for num in arr:
        if num in freq:
            freq[num] += 1 
        else:
            freq[num] = 1
    for key, val in freq.items():
        if val >= N // 3:
            print(key, end=" ")
    

def input_array_format():
    print("\n[e1,e2,e3]")
    arr = list(map(str, input().strip("[]").split(',')))
    findMajorityElement(arr, len(arr))

def input_space_separated():
    print("\nCase 2: space separated")
    arr = list(map(int, input().split()))
    findMajorityElementInt(arr, len(arr))


input_array_format()
input_space_separated()

================================================
FILE: 06 MAY SHIFT 1/SORT NUMBERS/code.cpp
================================================
#include <iostream>
#include <vector>

using namespace std;

vector<char> sortBySwap(vector<char>& arr, int N) {
    int left = 0;
    int mid = 0;
    int right = N - 1;
    while (mid <= right) {
        if (arr[mid] == '3') {
            swap(arr[left], arr[mid]);
            left++;
            mid++;
        } else if (arr[mid] == '6') {
            mid++;
        } else if (arr[mid] == '7') {
            swap(arr[right], arr[mid]);
            right--;
        }
    }
    return arr;
}

int main() {
    cout << "\nEnter space-separated elements: ";
    vector<char> arr;
    char c;
    while (cin >> c) {
        arr.push_back(c);
    }
    arr = sortBySwap(arr, arr.size());
    for (char c : arr) {
        cout << c << " ";
    }
    return 0;
}


================================================
FILE: 06 MAY SHIFT 1/SORT NUMBERS/code.java
================================================
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class SortBySwap {

    public static List<Character> sortBySwap(char[] arr, int N) {
        int left = 0;
        int mid = 0;
        int right = N - 1;
        while (mid <= right) {
            if (arr[mid] == '3') {
                char temp = arr[left];
                arr[left] = arr[mid];
                arr[mid] = temp;
                left++;
                mid++;
            } else if (arr[mid] == '6') {
                mid++;
            } else if (arr[mid] == '7') {
                char temp = arr[right];
                arr[right] = arr[mid];
                arr[mid] = temp;
                right--;
            }
        }
        List<Character> result = new ArrayList<>();
        for (char c : arr) {
            result.add(c);
        }
        return result;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("\nEnter space-separated elements: ");
        String input = scanner.nextLine();
        char[] arr = input.toCharArray();
        List<Character> sortedArr = sortBySwap(arr, arr.length);
        for (char c : sortedArr) {
            System.out.print(c + " ");
        }
    }
}


================================================
FILE: 06 MAY SHIFT 1/SORT NUMBERS/code.py
================================================
def sortBySwap(arr, N):
    left = 0
    mid = 0 
    right = N - 1 
    while mid <= right:
        if arr[mid] == '3':
            arr[left], arr[mid] = arr[mid], arr[left]
            left += 1
            mid += 1
        
        elif arr[mid] == '6':
            mid += 1

        elif arr[mid] == '7':
            arr[right], arr[mid] = arr[mid], arr[right]
            right -= 1
    return arr 

print("\nSpace separated")
arr = list(map(str, input().split()))
print(*sortBySwap(arr, len(arr)))




================================================
FILE: 06 MAY SHIFT 2/Missing number/code.cpp
================================================
#include <iostream>
#include <vector>
#include <sstream>

using namespace std;

int getMissingNumIntFormat(vector<int>& arr, int size) {
    int totalSum = 0;
    int n = size + 1;
    for (int num : arr) {
        totalSum += num;
    }
    int actualSum = (n * (n + 1)) / 2;
    return actualSum - totalSum;
}

int getMissingNumStrFormat(vector<string>& arr, int size) {
    int totalSum = 0;
    int n = size + 1;
    for (auto str : arr) {
        int num = stoi(str); // Convert string to integer using stoi
        totalSum += num;
    }
    int actualSum = (n * (n + 1)) / 2;
    return actualSum - totalSum;
}




void input_space_separated() {
    cout << "\nEnter space-separated elements: ";
    int N; 
    cin >> N;
    cin.ignore(); 
    string input;
    getline(cin, input);
    stringstream ss(input);
    int num;
    vector<int> arr;
    while (ss >> num) { 
        arr.push_back(num);
    }
    cout << "Missing number: " << getMissingNumIntFormat(arr, N) << endl;
}


void input_array_format() {
    cout << "\nEnter elements in format e1,e2,e3: ";
    string input;
    int N; cin >> N;
    cin.ignore(); 
    getline(cin, input);
    stringstream ss(input);
    string token;
    vector<string> arr;
    while (getline(ss, token, ',')) {
        arr.push_back(token);
    }
    cout << "Missing number: " << getMissingNumStrFormat(arr, N) << endl;
}

int main() {
    input_space_separated();
    input_array_format();
    return 0;
}


================================================
FILE: 06 MAY SHIFT 2/Missing number/code.java
================================================
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static int getMissingNumIntFormat(List<Integer> arr, int size) {
        int totalSum = 0;
        int n = size + 1;
        for (int num : arr) {
            totalSum += num;
        }
        int actualSum = (n * (n + 1)) / 2;
        return actualSum - totalSum;
    }

    public static int getMissingNumStrFormat(List<String> arr, int size) {
        int totalSum = 0;
        int n = size + 1;
        for (String str : arr) {
            int num = Integer.parseInt(str);
            totalSum += num;
        }
        int actualSum = (n * (n + 1)) / 2;
        return actualSum - totalSum;
    }

    public static void input_space_separated() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("\nEnter space-separated elements: ");
        int N = scanner.nextInt();
        scanner.nextLine(); // Consume the newline character left in the input buffer
        String input = scanner.nextLine();
        Scanner ss = new Scanner(input);
        List<Integer> arr = new ArrayList<>();
        while (ss.hasNextInt()) {
            arr.add(ss.nextInt());
        }
        System.out.println("Missing number: " + getMissingNumIntFormat(arr, N));
    }

    public static void input_array_format() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("\nEnter elements in format e1,e2,e3: ");
        int N = scanner.nextInt();
        scanner.nextLine(); 
        String input = scanner.nextLine();
        String[] tokens = input.split(",");
        List<String> arr = new ArrayList<>();
        for (String token : tokens) {
            arr.add(token);
        }
        System.out.println("Missing number: " + getMissingNumStrFormat(arr, N));
    }

    public static void main(String[] args) {
        input_space_separated();
        input_array_format();
    }
}


================================================
FILE: 06 MAY SHIFT 2/Missing number/code.py
================================================
def getMissingNumIntFormat(arr, size):
    totalSum = 0
    n = size + 1
    for num in arr:
        totalSum += num 
    
    actualSum = int((n * (n + 1) )/ 2)
    return actualSum - totalSum


def intFormat():
    N = int(input())
    arr = list(map(int, input().split()))
    print(getMissingNumIntFormat(arr, N))

def getMissingNumStrFormat(arr, size):
    totalSum = 0
    for num_str in arr:  
        num = int(num_str)
        totalSum += num 
    n = size + 1
    actualSum = int((n * (n + 1)) / 2)
    return actualSum - totalSum

def strFormat():
    N = int(input())
    arr = list(map(str, input().split(',')))
    print(getMissingNumStrFormat(arr, N))


intFormat()
strFormat()

================================================
FILE: 06 MAY SHIFT 2/Prime number/code.cpp
================================================
#include <iostream>

using namespace std;

bool isPrime(int number) {
    if (number <= 1) {  // 1 and below are not prime
        return false;
    }
    if (number <= 3) {  // 2 and 3 are prime
        return true;
    }
    if (number % 2 == 0 || number % 3 == 0) {  // Eliminate multiples of 2 and 3
        return false;
    }

    // Check divisibility by numbers of the form 6k ± 1, up to sqrt(n)
    int i = 5;
    while (i * i <= number) {
        if (number % i == 0 || number % (i + 2) == 0) {
            return false;
        }
        i += 6;
    }
    return true;
}

bool calculateSum(int n) {
    int sum = 0;
    while (n > 0) {
        int num = n % 10;
        sum += num;
        n /= 10;
    }
    return isPrime(sum);
}

int main() {
    int n, m;
    cin >> n >> m;
    for (int i = n; i <= m; i++) {
        if (isPrime(i) && calculateSum(i)) {
            cout << i << endl;
        }
    }
    return 0;
}


================================================
FILE: 06 MAY SHIFT 2/Prime number/code.java
================================================
import java.util.Scanner;

public class Main {

    public static boolean isPrime(int number) {
        if (number <= 1) {  // 1 and below are not prime
            return false;
        }
        if (number <= 3) {  // 2 and 3 are prime
            return true;
        }
        if (number % 2 == 0 || number % 3 == 0) {  // Eliminate multiples of 2 and 3
            return false;
        }

        // Check divisibility by numbers of the form 6k ± 1, up to sqrt(n)
        int i = 5;
        while (i * i <= number) {
            if (number % i == 0 || number % (i + 2) == 0) {
                return false;
            }
            i += 6;
        }
        return true;
    }

    public static boolean calculateSum(int n) {
        int sum = 0;
        while (n > 0) {
            int num = n % 10;
            sum += num;
            n /= 10;
        }
        return isPrime(sum);
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        for (int i = n; i <= m; i++) {S
            if (isPrime(i) && calculateSum(i)) {
                System.out.println(i);
            }
        }
    }
}


================================================
FILE: 06 MAY SHIFT 2/Prime number/code.py
================================================
def isPrime(number):
    if number <= 1: 
        return False
    if number <= 3:
        return True
    if number % 2 == 0 or number % 3 == 0:
        return False
    i = 5
    while i * i <= number:
        if number % i == 0 or number % (i + 2) == 0:
            return False
        i += 6
    return True

def calculateSum(n):
    sum = 0
    while n > 0:
        num = n % 10 
        sum += num 
        n /= 10
    if isPrime(sum):
        return True
    else:
        return False
        
n, m = map(int, input().split())
for i in range(n, m+1):
    if isPrime(i) and calculateSum(i):
        print(i)
    

================================================
FILE: 08 MAY SHIFT 2/SequenceQuestion/code.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

bool is_positive_integer(const string& str) {
    for (char c : str) {
        if (!isdigit(c)) {
            return false;
        }
    }
    return !str.empty() && stoi(str) > 0;
}

vector<int> generate_sequence(int n) {
    vector<int> sequence;
    sequence.push_back(n);
    while (n != 1) {
        if (n % 2 == 0)
            n /= 2;
        else
            n = 3 * n + 1;
        sequence.push_back(n);
    }
    return sequence;
}

pair<int, int> max_length_of_sequence_and_k(int n) {
    int maxLen = 0, kValue = 0;
    for (int i = 1; i <= n; ++i) {
        vector<int> sequence = generate_sequence(i);
        int currLen = sequence.size();
        if (currLen > maxLen) {
            maxLen = currLen;
            kValue = i;
        }
    }
    return make_pair(maxLen, kValue);
}

pair<int, int> max_sequence_value_and_k(int n) {
    int max_k = 0, max_val = 0;
    for (int k = 1; k <= n; ++k) {
        vector<int> sequence = generate_sequence(k);
        int max_val_k = *max_element(sequence.begin(), sequence.end());
        if (max_val_k > max_val) {
            max_val = max_val_k;
            max_k = k;
        }
    }
    return make_pair(max_val, max_k);
}

int main() {
    string n_str;
    cin >> n_str;
    if (is_positive_integer(n_str)) {
        int n = stoi(n_str);
        vector<int> sequence = generate_sequence(n);
        auto max_val_k = max_sequence_value_and_k(n);
        auto maxLen_kValue = max_length_of_sequence_and_k(n);
        cout << "Sequence: [";
        for (size_t i = 0; i < sequence.size(); ++i) {
            cout << sequence[i];
            if (i != sequence.size() - 1) {
                cout << ", ";
            }
        }
        cout << "]" << endl;
        cout << maxLen_kValue.first << " " << maxLen_kValue.second << endl;
        cout << max_val_k.first << " " << max_val_k.second << endl;
    } else {
        cout << "Error!" << endl;
    }
    return 0;
}



================================================
FILE: 08 MAY SHIFT 2/SequenceQuestion/code.java
================================================
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static boolean isPositiveInteger(String str) {
        for (char c : str.toCharArray()) {
            if (!Character.isDigit(c)) {
                return false;
            }
        }
        return !str.isEmpty() && Integer.parseInt(str) > 0;
    }

    public static List<Integer> generateSequence(int n) {
        List<Integer> sequence = new ArrayList<>();
        sequence.add(n);
        while (n != 1) {
            if (n % 2 == 0)
                n /= 2;
            else
                n = 3 * n + 1;
            sequence.add(n);
        }
        return sequence;
    }

    public static int[] maxLengthOfSequenceAndK(int n) {
        int maxLen = 0, kValue = 0;
        for (int i = 1; i <= n; i++) {
            List<Integer> sequence = generateSequence(i);
            int currLen = sequence.size();
            if (currLen > maxLen) {
                maxLen = currLen;
                kValue = i;
            }
        }
        return new int[]{maxLen, kValue};
    }

    public static int[] maxSequenceValueAndK(int n) {
        int max_k = 0, max_val = 0;
        for (int k = 1; k <= n; k++) {
            List<Integer> sequence = generateSequence(k);
            int max_val_k = sequence.stream().mapToInt(Integer::intValue).max().orElse(Integer.MIN_VALUE);
            if (max_val_k > max_val) {
                max_val = max_val_k;
                max_k = k;
            }
        }
        return new int[]{max_val, max_k};
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String n_str = scanner.nextLine();
        scanner.close();
        if (isPositiveInteger(n_str)) {
            int n = Integer.parseInt(n_str);
            List<Integer> sequence = generateSequence(n);
            int[] max_val_k = maxSequenceValueAndK(n);
            int[] maxLen_kValue = maxLengthOfSequenceAndK(n);
            System.out.print("Sequence: [");
            for (int i = 0; i < sequence.size(); i++) {
                System.out.print(sequence.get(i));
                if (i != sequence.size() - 1) {
                    System.out.print(", ");
                }
            }
            System.out.println("]");
            System.out.println(maxLen_kValue[0] + " " + maxLen_kValue[1]);
            System.out.println(max_val_k[0] + " " + max_val_k[1]);
        } else {
            System.out.println("Error!");
        }
    }
}


================================================
FILE: 08 MAY SHIFT 2/SequenceQuestion/code.py
================================================
def generate_sequence(n):
    sequence = [n]
    while n != 1:
        if n % 2 == 0:
            n //= 2
        else:
            n = 3 * n + 1
        sequence.append(n)
    return sequence


def max_length_of_sequence_and_k(n):
    maxLen = 0
    kValue = 0
    for i in range(1, n+1):
        sequence = generate_sequence(i)
        currLen = len(sequence)
        if currLen > maxLen:
            maxLen = currLen
            kValue = i 
    return maxLen, kValue


def max_sequence_value_and_k(n):
    max_k = 0
    max_val = 0
    for k in range(1, n + 1):
        sequence = generate_sequence(k)
        max_val_k = max(sequence)
        if max_val_k > max_val:
            max_val = max_val_k
            max_k = k
    return max_val, max_k


num = input()
if num.isdigit() and int(num) > 0:
    n = int(num)
    sequence = generate_sequence(n)
    max_val, max_k = max_sequence_value_and_k(n)
    max_length_of_sequence, k_value = max_length_of_sequence_and_k(n)
    print(sequence)
    print(max_length_of_sequence, k_value)
    print(max_val, max_k)
else:
    print("Error!")


================================================
FILE: 08 MAY SHIFT 2/fiveThree Program/code.cpp
================================================
#include <bits/stdc++.h>

using namespace std;

void solve(vector<string>& arr) {
    stringstream result;
    for (auto n : arr) {
        int num = stoi(n);
        if (num % 3 == 0 && num % 5 == 0) {
            cout << "ThreeFive " << " ";
        } else if (num % 5 == 0) {
            cout << "Five "<< " ";
        } else if (num % 3 == 0) {
            cout << "Three "<< " ";
        } else {
            cout << num << " ";
        }
    }
}

void input_array_format1() {
    int n; cin >> n;
    cin.ignore(); 
    string input;
    getline(cin, input);
    input.erase(remove(input.begin(), input.end(), '['), input.end()); // Remove '['
    input.erase(remove(input.begin(), input.end(), ']'), input.end()); // Remove ']'
    stringstream ss(input);
    vector<string> arr1;
    string element;
    while (ss >> element) { // Read elements separated by space
        arr1.push_back(element);
    }
    solve(arr1); // Print the result
}

int main() {
    input_array_format1();
    return 0;
}


================================================
FILE: 08 MAY SHIFT 2/fiveThree Program/code.java
================================================
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.StringJoiner;

public class Main {
    public static String solve(List<String> arr) {
        StringBuilder result = new StringBuilder();
        for (String n : arr) {
            int num = Integer.parseInt(n);
            if (num % 3 == 0 && num % 5 == 0) {
                result.append("ThreeFive ");
            } else if (num % 5 == 0) {
                result.append("Five ");
            } else if (num % 3 == 0) {
                result.append("Three ");
            } else {
                result.append(num).append(" ");
            }
        }
        return result.toString();
    }

    public static void inputArrayFormat1() {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine(); // Consume the newline character
        String input = scanner.nextLine();
        input = input.replaceAll("[\\[\\]]", ""); // Remove '[' and ']'
        String[] elements = input.split("\\s+");
        List<String> arr = new ArrayList<>();
        for (String element : elements) {
            arr.add(element);
        }
        System.out.println(solve(arr)); // Print the result
        scanner.close();
    }

    public static void main(String[] args) {
        inputArrayFormat1();
    }
}


================================================
FILE: 08 MAY SHIFT 2/fiveThree Program/code.py
================================================
def solve(arr, N):
    result = []
    for num in arr:
        if num % 3 == 0 and num % 5 == 0:
            print("ThreeFive", end = " ")
        elif num % 5 == 0:
            print("Five", end = " ")
        elif num % 3 == 0:
            print("Three", end = " ")
        else:
            print(num, end = " ")

def input_array_format1():
    N = int(input())
    arr = list(map(int, input().strip('[]').split()))
    solve(arr,N)

input_array_format1()

================================================
FILE: 09 MAY 2024 SHIFT - 1/Armstrong Number/code.cpp
================================================
#include <iostream>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

bool isArmStrongNumber(int n, int k) {
    int sum = 0;
    int originalNum = n;
    while (originalNum > 0) {
        int digit = originalNum % 10;
        sum += pow(digit, k);
        originalNum /= 10;
    }
    return sum == n;
}

int main() {
    string input;
    cout << "Enter numbers separated by commas: ";
    getline(cin, input);
    vector<string> arr;
    size_t pos = 0;
    while ((pos = input.find(',')) != string::npos) {
        arr.push_back(input.substr(0, pos));
        input.erase(0, pos + 1);
    }
    arr.push_back(input);
    int flag = 0;
    for (string num_str : arr) {
        int num = stoi(num_str);
        int n = num_str.length();
        if (isArmStrongNumber(num, n)) {
            cout << num << " ";
            flag = 1;
        }
    }
    if (flag == 0) {
        cout << "No Armstrong numbers present";
    }
    return 0;
}


================================================
FILE: 09 MAY 2024 SHIFT - 1/Armstrong Number/code.java
================================================
import java.util.Scanner;
import java.util.ArrayList;

public class ArmstrongNumber {
    static boolean isArmStrongNumber(int n, int k) {
        int sum = 0;
        int originalNum = n;
        while (originalNum > 0) {
            int digit = originalNum % 10;
            sum += Math.pow(digit, k);
            originalNum /= 10;
        }
        return sum == n;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter numbers separated by commas: ");
        String input = scanner.nextLine();
        String[] arr = input.split(",");
        ArrayList<String> numbers = new ArrayList<>();
        for (String num : arr) {
            numbers.add(num);
        }
        int flag = 0;
        for (String num_str : numbers) {
            int num = Integer.parseInt(num_str);
            int n = num_str.length();
            if (isArmStrongNumber(num, n)) {
                System.out.print(num + " ");
                flag = 1;
            }
        }
        if (flag == 0) {
            System.out.print("No Armstrong numbers present");
        }
        scanner.close();
    }
}


================================================
FILE: 09 MAY 2024 SHIFT - 1/Armstrong Number/code.py
================================================
def isArmStrongNumber(n, k):
    sum = 0
    originalNum = n
    while originalNum > 0:
        digit = originalNum % 10 
        sum += digit ** k 
        originalNum //= 10  
    
    if sum == n:
        return True 
    return False

arr = input("Enter numbers separated by commas: ").strip('[]').split(',')
flag = 0
for num_str in arr:
    num = int(num_str)
    n = len(str(num))
    if isArmStrongNumber(num, n):
        print(num, end=" ")
        flag = 1
if flag == 0:
    print("No Armstrong numbers present")


================================================
FILE: 09 MAY 2024 SHIFT - 1/print top K students/code.cpp
================================================
#include <bits/stdc++.h>

using namespace std;

int main() {
    string s;
    getline(cin, s);
    vector<string> l;
    string token;
    istringstream iss(s);
    while (iss >> token) {
        l.push_back(token);
    }
    int k = stoi(l[0]);
    int N = stoi(l[1]);
    vector<pair<int, string>> arr;

    for (int i = 2; i < l.size(); i += 2) {
        int marks = stoi(l[i]);
        string name = l[i + 1];
        arr.push_back(make_pair(marks, name));
    }

    sort(arr.begin(), arr.end(), greater<pair<int, string>>());

    for (int top = 0; top < k && top < arr.size(); top++) {
        cout << arr[top].second << ": " << arr[top].first << endl;
    }

    return 0;
}


================================================
FILE: 09 MAY 2024 SHIFT - 1/print top K students/code.java
================================================
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String[] l = s.split(" ");
        int k = Integer.parseInt(l[0]);
        int N = Integer.parseInt(l[1]);
        List<Pair<Integer, String>> arr = new ArrayList<>();

        for (int i = 2; i < l.length; i += 2) {
            int marks = Integer.parseInt(l[i]);
            String name = l[i + 1];
            arr.add(new Pair<>(marks, name));
        }

        Collections.sort(arr, new Comparator<Pair<Integer, String>>() {
            @Override
            public int compare(Pair<Integer, String> o1, Pair<Integer, String> o2) {
                return Integer.compare(o2.getKey(), o1.getKey());
            }
        });

        for (int top = 0; top < k && top < arr.size(); top++) {
            Pair<Integer, String> pair = arr.get(top);
            System.out.println(pair.getValue() + ": " + pair.getKey());
        }
    }
}


================================================
FILE: 09 MAY 2024 SHIFT - 1/print top K students/code.py
================================================
s = input()
l = s.split()
k, N = int(l[0]), int(l[1])
arr = []
for i in range(2, len(l), 2):
    marks, name = int(l[i]), l[i+1]
    arr.append((marks, name))
sorted_array = sorted(arr, key=lambda x: x[0], reverse=True)

for top in range(k):
    marks, name = sorted_array[top]
    print("{}: {}".format(name, marks))


================================================
FILE: 14 May Shift 1/Maximum Sum of Subarray/codeCpp.cpp
================================================
#include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>

using namespace std;

int main() {
    string input;
    getline(cin, input);
    stringstream ss(input);
    vector<int> nums;
    int num;
    while (ss >> num) {
        nums.push_back(num);
    }
    int maxSum = nums[0];
    int currentSum = 0;
    for (int i = 0; i < nums.size(); ++i) {
        currentSum += nums[i];
        if (currentSum > maxSum) {
            maxSum = max(currentSum, maxSum);
        }
        if (currentSum < 0) {
            currentSum = 0;
        }
    }
    cout << maxSum << endl;
    return 0;
}


================================================
FILE: 14 May Shift 1/Maximum Sum of Subarray/codeJava.java
================================================
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] strNums = scanner.nextLine().split(" ");
        int[] nums = new int[strNums.length];
        for (int i = 0; i < nums.length; i++) {
            nums[i] = Integer.parseInt(strNums[i]);
        }
        int maxSum = nums[0];
        int currentSum = 0;
        for (int i = 0; i < nums.length; i++) {
            currentSum += nums[i];
            if (currentSum > maxSum) {
                maxSum = Math.max(currentSum, maxSum);
            }
            if (currentSum < 0) {
                currentSum = 0;
            }
        }
        System.out.println(maxSum);
    }
}


================================================
FILE: 14 May Shift 1/Maximum Sum of Subarray/codePy.py
================================================
nums = list(map(int, input().split()))
maxSum = nums[0]
currentSum = 0
for i in range(len(nums)):
    currentSum += nums[i]
    if currentSum > maxSum:
        maxSum = max(currentSum, maxSum)
    if currentSum < 0:
        currentSum = 0
print(maxSum)

================================================
FILE: 14 May Shift 1/Sum of unique elements/codeCpp.cpp
================================================
#include <iostream>
#include <unordered_map>
#include <vector>
#include <sstream>

using namespace std;

int main() {
    string input;
    getline(cin, input);
    stringstream ss(input);
    vector<int> nums;
    int num;
    while (ss >> num) {
        nums.push_back(num);
    }
    unordered_map<int, int> d;
    for (int i = 0; i < nums.size(); ++i) {
        if (d.find(nums[i]) == d.end()) {
            d[nums[i]] = 1;
        } else {
            d[nums[i]]++;
        }
    }
    int ans = 0;
    for (auto it: d) {
        if (it.second == 1) {
            ans += it.first;
        }
    }
    cout << ans << endl;
    return 0;
}


================================================
FILE: 14 May Shift 1/Sum of unique elements/codeJava.java
================================================
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] strNums = scanner.nextLine().split(" ");
        int[] nums = new int[strNums.length];
        for (int i = 0; i < nums.length; i++) {
            nums[i] = Integer.parseInt(strNums[i]);
        }
        Map<Integer, Integer> d = new HashMap<>();
        for (int num : nums) {
            if (!d.containsKey(num)) {
                d.put(num, 1);
            } else {
                d.put(num, d.get(num) + 1);
            }
        }
        int ans = 0;
        for (int key : d.keySet()) {
            if (d.get(key) == 1) {
                ans += key;
            }
        }
        System.out.print(ans);
    }
}


================================================
FILE: 14 May Shift 1/Sum of unique elements/codePy.py
================================================
nums = list(map(int, input().split()))
d = {}
for i in range(len(nums)):
    if nums[i] not in d:
        d[nums[i]] = 1
    else:
        d[nums[i]] += 1
ans = 0
for i in d.keys():
    if d[i] == 1:
        ans+=i
print(ans)

================================================
FILE: 14 May Shift 2/Cost of shipping/codeCpp.cpp
================================================
#include <bits/stdc++.h>

double calculate_total_cost(int weight, int distance) {
    double base_money = 5.00;
    double cost_per_kg = 2.00;
    double cost_per_10_km = 0.50;
    
    double weight_cost = weight * cost_per_kg;
    double distance_cost = (distance / 10) * cost_per_10_km;
    
    double total_cost = base_money + weight_cost + distance_cost;
    return total_cost;
}

int main() {
    int weight, distance;
    
    std::cin >> weight;
    std::cin >> distance;
    
    double total_cost = calculate_total_cost(weight, distance);
    
    char output[50];
    sprintf(output, "$%.2f", total_cost);
    
    std::cout << output << std::endl;
    
    return 0;
}


================================================
FILE: 14 May Shift 2/Cost of shipping/codeJava.java
================================================
import java.util.Scanner;

public class Main {
    
    public static double calculateTotalCost(int weight, int distance) {
        double baseMoney = 5.00;
        double costPerKg = 2.00;
        double costPer10Km = 0.50;
        
        double weightCost = weight * costPerKg;
        double distanceCost = (distance / 10) * costPer10Km;
        
        double totalCost = baseMoney + weightCost + distanceCost;
        return totalCost;
    }
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        int weight = scanner.nextInt();
        int distance = scanner.nextInt();
        
        double totalCost = calculateTotalCost(weight, distance);
        System.out.printf("$%.2f%n", totalCost);
        
        scanner.close();
    }
}


================================================
FILE: 14 May Shift 2/Cost of shipping/codePy.py
================================================
def calculate_total_cost(weight, distance):
    base_money = 5.00
    cost_per_kg = 2.00
    cost_per_10_km = 0.50
    
    weight_cost = weight * cost_per_kg
    distance_cost = (distance // 10) * cost_per_10_km
    
    total_cost = base_money + weight_cost + distance_cost
    return total_cost


weight = int(input())
distance = int(input())


total_cost = calculate_total_cost(weight, distance)
print(f"${total_cost:.2f}")


================================================
FILE: 14 May Shift 2/Number of Subarray of sum of K/codeCpp.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

int subarraySum(vector<int>& arr, int k) {
    unordered_map<int, int> mpp;
    mpp[0] = 1;
    int preSum = 0, cnt = 0;
    for (int i = 0; i < arr.size(); ++i) {
        preSum += arr[i];
        int rest = preSum - k;
        cnt += mpp[rest];
        mpp[preSum] += 1;
    }
    return cnt;
}

int main() {
    string inputLine;
    getline(cin, inputLine);
    istringstream iss(inputLine);
    vector<int> arr;
    int number;
    while (iss >> number) {
        arr.push_back(number);
    }

    int k;
    cin >> k;

    int result = subarraySum(arr, k);
    cout << result << endl;

    return 0;
}


================================================
FILE: 14 May Shift 2/Number of Subarray of sum of K/codeJava.java
================================================
import java.util.*;

public class Main {

    public static int subarraySum(int[] arr, int k) {
        Map<Integer, Integer> mpp = new HashMap<>();
        mpp.put(0, 1);
        int preSum = 0, cnt = 0;

        for (int num : arr) {
            preSum += num;
            int remove = preSum - k;
            cnt += mpp.getOrDefault(remove, 0);
            mpp.put(preSum, mpp.getOrDefault(preSum, 0) + 1);
        }

        return cnt;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String inputLine = scanner.nextLine();
        String[] inputStrings = inputLine.split(" ");
        int[] arr = new int[inputStrings.length];
        for (int i = 0; i < inputStrings.length; i++) {
            arr[i] = Integer.parseInt(inputStrings[i]);
        }


        int k = scanner.nextInt();

        int result = subarraySum(arr, k);
        System.out.println(result);
        
        scanner.close();
    }
}


================================================
FILE: 14 May Shift 2/Number of Subarray of sum of K/codePy.py
================================================
def subarray_sum(arr, k):
    mpp = {0: 1}
    pre_sum = 0
    cnt = 0
    
    for num in arr:
        pre_sum += num
        rest = pre_sum - k
        cnt += mpp.get(rest, 0)
        mpp[pre_sum] = mpp.get(pre_sum, 0) + 1
    
    return cnt


arr = list(map(int, input().split()))
k = int(input())

result = subarray_sum(arr, k)
print(result)


================================================
FILE: 26 APRIL 2024 SHIFT - 1/Find subarray equals to target/codeCpp.cpp
================================================
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;

void bruteForce(vector<int>& arr, int n, int target) {
    for (int i = 0; i < n; i++) {
        int curSum = 0;
        for (int j = i; j < n; j++) {
            curSum += arr[j];
            if (curSum == target) {
                for (int k = i; k <= j; k++) {
                    cout << arr[k] << " ";
                }
                cout << endl;
            }
        }
    }
}

void optimalApproach(vector<int>& arr, int n, int target) {
    unordered_map<int, int> sumMap;
    int curSum = 0;
    for (int i = 0; i < n; i++) {
        curSum += arr[i];
        if (curSum == target) {
            for (int j = 0; j <= i; j++) {
                cout << arr[j] << " ";
            }
            cout << endl;
        }
        if (sumMap.find(curSum - target) != sumMap.end()) {
            int startIndex = sumMap[curSum - target] + 1;
            for (int k = startIndex; k <= i; k++) {
                cout << arr[k] << " ";
            }
            cout << endl;
        }
        sumMap[curSum] = i;
    }
}

int main() {
    vector<int> arr = {3, 4, -7, 1, 3, 3, 1, -4};
    int N = arr.size();
    int target = 7;
    optimalApproach(arr, N, target);
    return 0;
}


================================================
FILE: 26 APRIL 2024 SHIFT - 1/Find subarray equals to target/codeJava.java
================================================
import java.util.HashMap;

public class Main {
    static void bruteForce(int[] arr, int n, int target) {
        for (int i = 0; i < n; i++) {
            int curSum = 0;
            for (int j = i; j < n; j++) {
                curSum += arr[j];
                if (curSum == target) {
                    for (int k = i; k <= j; k++) {
                        System.out.print(arr[k] + " ");
                    }
                    System.out.println();
                }
            }
        }
    }

    static void optimalApproach(int[] arr, int n, int target) {
        HashMap<Integer, Integer> sumMap = new HashMap<>();
        int curSum = 0;
        for (int i = 0; i < n; i++) {
            curSum += arr[i];
            if (curSum == target) {
                for (int j = 0; j <= i; j++) {
                    System.out.print(arr[j] + " ");
                }
                System.out.println();
            }
            if (sumMap.containsKey(curSum - target)) {
                int startIndex = sumMap.get(curSum - target) + 1;
                for (int k = startIndex; k <= i; k++) {
                    System.out.print(arr[k] + " ");
                }
                System.out.println();
            }
            sumMap.put(curSum, i);
        }
    }

    public static void main(String[] args) {
        int[] arr = {3, 4, -7, 1, 3, 3, 1, -4};
        int N = arr.length;
        int target = 7;
        optimalApproach(arr, N, target);
    }
}


================================================
FILE: 26 APRIL 2024 SHIFT - 1/Find subarray equals to target/subArraySum.py
================================================
def bruteFroce(arr, n, target):
    for i in range(n):
        curSum = 0
        for j in range(i, n):
            curSum += arr[j]
            if curSum == target:
                print(arr[i:j+1])

def optimalApp (arr, n, target):
    sumMap = {}
    curSum = 0
    for i in range(n):
        curSum += arr[i]
        if curSum == target:
            print(arr[:i+1])
        if curSum - target in sumMap:
            startIndex = sumMap[curSum - target]+1
            print(arr[startIndex : i+1])
        sumMap[curSum] = i 

arr = list(map(int, input().split())) # 3 4 -7 1 3 3 1 -4
N = len(arr)
target = int(input())
# bruteFroce(arr, N, target)
optimalApp(arr, N, target)


================================================
FILE: 26 APRIL 2024 SHIFT - 1/Unique Paths/codeCpp.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

class Solution {
private:
    int f(int i, int j, vector<vector<int>> &dp){
        if(i == 0 && j == 0) return 1;
        if(i < 0 || j < 0) return 0;

        if(dp[i][j] != -1) return dp[i][j];

        int up = f(i-1, j, dp);
        int left = f(i, j-1, dp);
        return dp[i][j] = up + left;
    }
public:
    int uniquePaths(int m, int n) {
        vector<vector<int>> dp (m, vector<int>(n, -1));
        return f(m-1, n-1, dp);
    }
};

================================================
FILE: 26 APRIL 2024 SHIFT - 1/Unique Paths/codeJava.java
================================================
public class Solution {
    public int f(int i, int j, int[][] dp) {
        if (i == 0 && j == 0) return 1;
        if (i < 0 || j < 0) return 0;

        if (dp[i][j] != -1) return dp[i][j];

        int up = f(i - 1, j, dp);
        int left = f(i, j - 1, dp);
        dp[i][j] = up + left;
        return dp[i][j];
    }

    public int uniquePaths(int m, int n) {
        int[][] dp = new int[m][n];
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                dp[i][j] = -1;
            }
        }
        return f(m - 1, n - 1, dp);
    }
}


================================================
FILE: 26 APRIL 2024 SHIFT - 1/Unique Paths/uniquePaths.py
================================================
class Solution:
    def __init__(self):
        pass
    
    def f(self, i, j, dp):
        if i == 0 and j == 0:
            return 1
        if i < 0 or j < 0:
            return 0

        if dp[i][j] != -1:
            return dp[i][j]

        up = self.f(i - 1, j, dp)
        left = self.f(i, j - 1, dp)
        dp[i][j] = up + left
        return dp[i][j]

    def uniquePaths(self, m, n):
        dp = [[-1] * n for _ in range(m)]
        return self.f(m - 1, n - 1, dp)


================================================
FILE: 26 APRIL 2024 SHIFT - 2/Cube sum/code.cpp
================================================
#include <iostream>

using namespace std;

void findCubeSum(int start, int end) {
    int cubeSum = 0;
    for (int i = start; i <= end; i++) {
        cubeSum += i * i * i;
    }
    cout << cubeSum << endl;
}

int main() {
    int start, end;
    cin >> start >> end;
    findCubeSum(start, end);
    return 0;
}


================================================
FILE: 26 APRIL 2024 SHIFT - 2/Cube sum/code.java
================================================
import java.util.Scanner;

public class Main {
    public static void findCubeSum(int start, int end) {
        int cubeSum = 0;
        for (int i = start; i <= end; i++) {
            cubeSum += Math.pow(i, 3);
        }
        System.out.println(cubeSum);
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int start = scanner.nextInt();
        int end = scanner.nextInt();
        findCubeSum(start, end);
        scanner.close();
    }
}


================================================
FILE: 26 APRIL 2024 SHIFT - 2/Cube sum/cubeSum.py
================================================
def findCubeSum(start, end):
    cubeSum = 0
    for i in range(start, end+1):
        cubeSum += i ** 3 # i * i * i 
    print(cubeSum)

start, end  = map(int, input().split())
# start = int(input())
# end = int(input())
findCubeSum(start, end)

================================================
FILE: 26 APRIL 2024 SHIFT - 2/Find Most sell item-avg-totalsell/code.cpp
================================================
#include <iostream>
#include <string>
#include <map>

using namespace std;

int main() {
    int n;
    cin >> n;

    // Method 1
    int maxCost = 0;
    string maxCostItem = "";
    double totalPrice = 0;
    double avg = 0;

    for (int i = 0; i < n; i++) {
        string item;
        int quantity, price;
        cin >> item >> quantity >> price;

        totalPrice += quantity * price;
        if (totalPrice > maxCost) {
            maxCostItem = item;
        }
        avg = totalPrice / (i + 1);
    }

    cout << "Task 1 - Item: " << maxCostItem << "\nTotal price: " << fixed << totalPrice << "\nAverage Price: " << avg << endl;

    // Method 2
    map<string, double> store;
    maxCost = 0;
    maxCostItem = "";
    totalPrice = 0;

    for (int i = 0; i < n; i++) {
        string item;
        int quantity, price;
        cin >> item >> quantity >> price;
        totalPrice = quantity * price;
        store[item] += totalPrice;

        if (maxCost < store[item]) {
            maxCostItem = item;
            maxCost = store[item];
        }
    }

    double total = 0;
    for (auto& pair : store) {
        total += pair.second;
    }
    avg = total / n;

    cout << "\nTask 2 - Item: " << maxCostItem << "\nTotal price: " << fixed << total << "\nAverage Price: " << avg << endl;

    return 0;
}


================================================
FILE: 26 APRIL 2024 SHIFT - 2/Find Most sell item-avg-totalsell/code.java
================================================
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        // Method 1
        int maxCost = 0;
        String maxCostItem = "";
        double totalPrice = 0;
        double avg = 0;

        for (int i = 0; i < n; i++) {
            String item = scanner.next();
            int quantity = scanner.nextInt();
            int price = scanner.nextInt();

            totalPrice += quantity * price;
            if (totalPrice > maxCost) {
                maxCostItem = item;
            }
            avg = totalPrice / (i + 1);
        }

        System.out.printf("Task 1 - Item: %s\nTotal price: %.2f\nAverage Price: %.2f\n", maxCostItem, totalPrice, avg);

        // Method 2
        Map<String, Double> store = new HashMap<>();
        maxCost = 0;
        maxCostItem = "";
        totalPrice = 0;

        for (int i = 0; i < n; i++) {
            String item = scanner.next();
            int quantity = scanner.nextInt();
            int price = scanner.nextInt();
            totalPrice = quantity * price;
            store.put(item, store.getOrDefault(item, 0.0) + totalPrice);

            if (maxCost < store.get(item)) {
                maxCostItem = item;
                maxCost = store.get(item).intValue();
            }
        }

        double total = store.values().stream().mapToDouble(Double::doubleValue).sum();
        avg = total / n;

        System.out.printf("\nTask 2 - Item: %s\nTotal price: %.2f\nAverage Price: %.2f\n", maxCostItem, total, avg);

        scanner.close();
    }
}


================================================
FILE: 26 APRIL 2024 SHIFT - 2/Find Most sell item-avg-totalsell/code.py
================================================
n = int(input())
maxCost = 0
maxCostItem = ""
totalPrice = 0
avg = 0
for i in range(n):
    item = input()
    quantity = int(input())
    price = int(input())

    totalPrice  += quantity * price 
    if totalPrice > maxCost:
        maxCostItem = item 
    avg = totalPrice / (i+1)

print("Item: {} \nTotal price: {:.2f}\n Average Price: {:.2f}".format(maxCostItem, totalPrice, avg))

store = {}
for i in range(n):
    item = input()
    quantity = int(input())
    price = int(input())
    totalPrice = quantity * price
    store[item] = store.get(item, 0) + totalPrice

total = 0
for key, val in store.items(): 
    if maxCost < val:
        maxCostItem = key
        maxCost = val 
    total += val 

average = total / n

print("Item: {} \nTotal price: {:.2f}\n Average Price: {:.2f}".format(maxCostItem, total, average))
    

    



================================================
FILE: 29 APRIL 2024 Shift - 1/Maximum element of subarray/code.cpp
================================================
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

void solve(vector<int>& arr, int k) {
    vector<int> ans;
    for (int i = 0; i < arr.size() - k + 1; i++) {
        priority_queue<int> maxHeap;
        for (int j = i; j < i + k; j++) {
            maxHeap.push(arr[j]);
        }
        ans.push_back(maxHeap.top());
    }
    for (int num : ans) {
        cout << num << " ";
    }
    cout << endl;
}

void optimalSolution(vector<int>& arr, int k) {
    priority_queue<pair<int, int>> maxHeap;
    vector<int> ans;

    for (int i = 0; i < k; i++) {
        maxHeap.push({arr[i], i});
    }
    ans.push_back(maxHeap.top().first);

    for (int i = k; i < arr.size(); i++) {
        maxHeap.push({arr[i], i});
        while (maxHeap.top().second <= i - k) {
            maxHeap.pop();
        }
        ans.push_back(maxHeap.top().first);
    }
    for (int num : ans) {
        cout << num << " ";
    }
    cout << endl;
}

int main() {
    vector<int> arr;
    int num;
    while (cin >> num) {
        arr.push_back(num);
        if (cin.get() == '\n') break;
    }
    int k;
    cin >> k;
    solve(arr, k);
    optimalSolution(arr, k);
    return 0;
}


================================================
FILE: 29 APRIL 2024 Shift - 1/Maximum element of subarray/code.java
================================================
import java.util.*;

public class Main {
    public static void solve(ArrayList<Integer> arr, int k) {
        ArrayList<Integer> ans = new ArrayList<>();
        for (int i = 0; i < arr.size() - k + 1; i++) {
            PriorityQueue<Integer> maxHeap = new PriorityQueue<>(Collections.reverseOrder());
            for (int j = i; j < i + k; j++) {
                maxHeap.offer(arr.get(j));
            }
            ans.add(maxHeap.peek());
        }
        for (int num : ans) {
            System.out.print(num + " ");
        }
        System.out.println();
    }

    public static void optimalSolution(ArrayList<Integer> arr, int k) {
        PriorityQueue<int[]> maxHeap = new PriorityQueue<>((a, b) -> b[0] - a[0]);
        ArrayList<Integer> ans = new ArrayList<>();

        for (int i = 0; i < k; i++) {
            maxHeap.offer(new int[]{arr.get(i), i});
        }
        ans.add(maxHeap.peek()[0]);

        for (int i = k; i < arr.size(); i++) {
            maxHeap.offer(new int[]{arr.get(i), i});
            while (maxHeap.peek()[1] <= i - k) {
                maxHeap.poll();
            }
            ans.add(maxHeap.peek()[0]);
        }
        for (int num : ans) {
            System.out.print(num + " ");
        }
        System.out.println();
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ArrayList<Integer> arr = new ArrayList<>();
        while (scanner.hasNextInt()) {
            arr.add(scanner.nextInt());
            if (scanner.hasNextLine()) {
                String nextLine = scanner.nextLine();
                if (nextLine.isEmpty()) break;
            }
        }
        int k = scanner.nextInt();
        solve(arr, k);
        optimalSolution(arr, k);
    }
}


================================================
FILE: 29 APRIL 2024 Shift - 1/Maximum element of subarray/code.py
================================================
import heapq
def solve(arr, k):
    ans = []
    for i in range(len(arr) - k + 1):
        maxi = arr[i]
        for j in range(i, i+k):
            maxi = max(maxi, arr[j])
        ans.append(maxi)
    print(*ans)

def optimalSolution(arr, k):
    heap = []
    ans = []

    for i in range(k):
        heapq.heappush(heap, (-arr[i], i))
    ans.append(-heap[0][0])

    for i in range(k, len(arr)):
        heapq.heappush(heap, (-arr[i], i))
        while heap[0][1] <= i - k:
            heapq.heappop(heap)
        ans.append(-heap[0][0])
    print(*ans)
    


arr = list(map(int, input().split()))
k  = int(input())
solve(arr, k)
optimalSolution(arr, k)

================================================
FILE: 29 APRIL 2024 Shift - 1/Maximum element of subarray/tempCodeRunnerFile.py
================================================



================================================
FILE: 29 APRIL 2024 Shift - 1/Multiplication table/code.cpp
================================================
#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    int mSum = 0;
    for (int i = 1; i <= n; i++) {
        mSum += n * i;
    }
    cout << mSum << endl;
    return 0;
}


================================================
FILE: 29 APRIL 2024 Shift - 1/Multiplication table/code.java
================================================
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int mSum = 0;
        for (int i = 1; i <= n; i++) {
            mSum += n * i;
        }
        System.out.println(mSum);
    }
}


================================================
FILE: 29 APRIL 2024 Shift - 1/Multiplication table/code.py
================================================
n = int(input())
mSum = 0
for i in range(1, n+1):
    mSum += n * i 
print(mSum)

================================================
FILE: 29 APRIL SHIFT 2/Bit OR Sum/code.cpp
================================================
#include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;

int subarrayBitwiseORs(vector<int>& arr) {
    vector<int> res;
    int left = 0;
    for (int num : arr) {
        int right = res.size();
        res.push_back(num);
        for (int i = left; i < right; ++i) {
            int value = res[i] | num;
            if (res.back() != value) {
                res.push_back(value);
            }
        }
        left = right;
    }
    return unordered_set<int>(res.begin(), res.end()).size();
}

int main() {
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; ++i) {
        cin >> arr[i];
    }
    cout << subarrayBitwiseORs(arr) << endl;
    return 0;
}


================================================
FILE: 29 APRIL SHIFT 2/Bit OR Sum/code.java
================================================
import java.util.*;

public class SubarrayBitwiseORs {
    public static int subarrayBitwiseORs(int[] arr) {
        List<Integer> res = new ArrayList<>();
        int left = 0;
        for (int num : arr) {
            int right = res.size();
            res.add(num);
            for (int i = left; i < right; ++i) {
                int value = res.get(i) | num;
                if (res.get(res.size() - 1) != value) {
                    res.add(value);
                }
            }
            left = right;
        }
        Set<Integer> resultSet = new HashSet<>(res);
        return resultSet.size();
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; ++i) {
            arr[i] = scanner.nextInt();
        }
        System.out.println(subarrayBitwiseORs(arr));
        scanner.close();
    }
}


================================================
FILE: 29 APRIL SHIFT 2/Bit OR Sum/code.py
================================================
def subarrayBitwiseORs(arr):
    res = []
    left = 0
    for num in arr:
        right = len(res)
        res.append(num)
        for i in range(left, right):
            value = res[i] | num
            if (res[-1] != value):
                res.append(value)
        left = right
    return len(set(res))

arr = list(map(int, input().split()))
print(subarrayBitwiseORs(arr))

================================================
FILE: 29 APRIL SHIFT 2/FIbonacci/code.cpp
================================================
#include <iostream>
using namespace std;

int fibonacci(int n) {
    int a = 0, b = 1, sum=1;
    if (n < 0) {
        cout << "Incorrect input" << endl;
        return -1; // or any error code you prefer
    } else if (n == 0) {
        return a;
    } else if (n == 1) {
        return b;
    } else {
        for (int i = 2; i < n; ++i) {
            int c = a + b;
            sum += c;
            a = b;
            b = c;
        }
        return sum;
    }
}

int main() {
    int n;
    cin >> n;
    cout << fibonacci(n) << endl;
    return 0;
}


================================================
FILE: 29 APRIL SHIFT 2/FIbonacci/code.java
================================================
import java.util.Scanner;

public class Fibonacci {
    public static int fibonacci(int n) {
        int a = 0, b = 1;
        if (n < 0) {
            System.out.println("Incorrect input");
            return -1; // or any error code you prefer
        } else if (n == 0) {
            return a;
        } else if (n == 1) {
            return b;
        } else {
            for (int i = 2; i <= n; ++i) {
                int c = a + b;
                a = b;
                b = c;
            }
            return b;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(fibonacci(n));
        scanner.close();
    }
}


================================================
FILE: 29 APRIL SHIFT 2/FIbonacci/code.py
================================================
def fibonacci(n):
    prev2, prev = 0, 1
    if n == 0:
        return prev2 
    if n == 1:
        return prev 
    fibSum = 1
    for i in range(2, n):
        cur = prev2 + prev 
        fibSum += cur
        print("FibSum: ", fibSum)
        prev2, prev = prev, cur
    return fibSum

n = int(input())
print(fibonacci(n))

================================================
FILE: 3 May SHIFT 2/Maximum Efficiency/code.cpp
================================================
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> arr(N);
    for (int i = 0; i < N; ++i) {
        cin >> arr[i];
    }
    sort(arr.begin(), arr.end());

    // Max values
    int emp1 = arr[N - 1];
    int emp2 = arr[N - 2];
    int emp3 = arr[N - 3];

    // Negative case
    int neg1 = arr[0];
    int neg2 = arr[1];

    cout << max(emp1 * emp2 * emp3, neg1 * neg2 * emp1) << endl;

    return 0;
}


================================================
FILE: 3 May SHIFT 2/Maximum Efficiency/code.java
================================================
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] arr = new int[N];
        for (int i = 0; i < N; ++i) {
            arr[i] = scanner.nextInt();
        }
        Arrays.sort(arr);

        // Max values
        int emp1 = arr[N - 1];
        int emp2 = arr[N - 2];
        int emp3 = arr[N - 3];

        // Negative case
        int neg1 = arr[0];
        int neg2 = arr[1];

        System.out.println(Math.max(emp1 * emp2 * emp3, neg1 * neg2 * emp1));
    }
}


================================================
FILE: 3 May SHIFT 2/Maximum Efficiency/code.py
================================================
N = int(input())
arr = list(map(int, input().split()))
arr.sort()

#Max values
emp1 = arr[N-1]
emp2 = arr[N-2]
emp3 = arr[N-3]

#negative case
neg1 = arr[0]
neg2 = arr[1]

print(max(emp1 * emp2 * emp3, neg1 * neg2 * emp1))


================================================
FILE: 3 May SHIFT 2/Pairs of shoes/code.cpp
================================================
#include <iostream>
#include <unordered_map>
#include <string>
using namespace std;

int main() {
    int N;
    cin >> N;
    unordered_map<string, int> store;

    for (int i = 0; i < N; ++i) {
        string shoeSize;
        cin >> shoeSize;
        if (store.find(shoeSize) != store.end()) {
            store[shoeSize]++;
        } else {
            store[shoeSize] = 1;
        }
    }

    int pairs = 0;
    for (auto& it : store) {
        string key = it.first;
        int val = it.second;
        string opposite;
        if (key[key.size() - 1] == 'L') {
            opposite = key.substr(0, key.size() - 1) + 'R';
        } else {
            opposite = key.substr(0, key.size() - 1) + 'L';
        }
        if (store.find(opposite) != store.end()) {
            pairs += min(val, store[opposite]);
        }
    }

    cout << pairs / 2 << endl; 

    return 0;
}


================================================
FILE: 3 May SHIFT 2/Pairs of shoes/code.java
================================================
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        Map<String, Integer> store = new HashMap<>();

        for (int i = 0; i < N; i++) {
            String shoeSize = scanner.next();
            store.put(shoeSize, store.getOrDefault(shoeSize, 0) + 1);
        }

        int pairs = 0;
        for (Map.Entry<String, Integer> entry : store.entrySet()) {
            String key = entry.getKey();
            int val = entry.getValue();
            String opposite;
            if (key.charAt(key.length() - 1) == 'L') {
                opposite = key.substring(0, key.length() - 1) + 'R';
            } else {
                opposite = key.substring(0, key.length() - 1) + 'L';
            }
            if (store.containsKey(opposite)) {
                pairs += Math.min(val, store.get(opposite));
            }
        }

        System.out.println(pairs / 2); // Dividing by 2 as we are counting pairs
    }
}


================================================
FILE: 3 May SHIFT 2/Pairs of shoes/code.py
================================================
N = int(input())
l = list(map(str, input().split()))
store = {}
for shoeSize in l:
    if shoeSize in store:
        store[shoeSize] += 1 
    else:
        store[shoeSize] = 1

pairs = 0
for key, val in store.items():
    if key[-1] == 'L':
        val = key[:-1] + 'R'
        if val in store:
            pairs += min(store[key], store[val])
    else:
        val = key[:-1] + 'L'
        if val in store:
            pairs += min(store[key], store[val])
print(pairs // 2) 


================================================
FILE: 3 May Shift 1/Number Divisible/code.cpp
================================================
#include <iostream>

bool isDivisibleByNine(int number) {
    return number % 9 == 0;
}

int main() {
    int number;
    std::cin >> number;
    if (number >= 100 && number <= 999) {
        if (isDivisibleByNine(number)) {
            std::cout << "Number " << number << " is divisible by 9" << std::endl;
        } else {
            std::cout << "Number " << number << " is not divisible by 9" << std::endl;
        }
    }

    return 0;
}


================================================
FILE: 3 May Shift 1/Number Divisible/code.java
================================================
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int number = scanner.nextInt();
        if (number >= 100 && number <= 999) {
            if (number % 9 == 0) {
                System.out.println("Number " + number + " is divisible by 9");
            } else {
                System.out.println("Number " + number + " is not divisible by 9");
            }
        }
    }
}


================================================
FILE: 3 May Shift 1/Number Divisible/code.py
================================================
def check_divisibility(number):
    if 100 <= number <= 999:
        if number % 9 == 0:
            print(f"Number {number} is divisible by 9")
        else:
            print(f"Number {number} is not divisible by 9")

# Input a three-digit integer
number = int(input())
check_divisibility(number)


================================================
FILE: 3 May Shift 1/maximum difference between smallest and largest/code.cpp
================================================
#include <bits/stdc++.h>

using namespace std;

int solve(vector<string>& arr) {
    int largest = INT_MIN;
    int maxDiff = INT_MIN;
    for (int i = arr.size() - 1; i >= 0; --i) {
        try {
            int num = stoi(arr[i]);
            largest = max(largest, num);
            maxDiff = max(maxDiff, largest - num);
        } catch (const std::invalid_argument& e) {
            // Handle invalid input
            std::cerr << "Invalid input: " << arr[i] << std::endl;
        }
    }
    return maxDiff;
}

int solveInt(vector<int>& arr) {
    int largest = INT_MIN;
    int maxDiff = INT_MIN;
    for (int i = arr.size() - 1; i >= 0; --i) {
        int num = arr[i];
        largest = max(largest, num);
        maxDiff = max(maxDiff, largest - num);
    }
    return maxDiff;
}

int main() {
    // Input array format
    cout << "Enter elements separated by commas within square brackets like [element1,element2,...]: ";
    string input;
    getline(cin, input);
    input.erase(remove(input.begin(), input.end(), '['), input.end()); // Remove '['
    input.erase(remove(input.begin(), input.end(), ']'), input.end()); // Remove ']'
    stringstream ss(input);
    vector<string> arr1;
    string element;
    while (getline(ss, element, ',')) {
        arr1.push_back(element);
    }
    cout << "Case 1 - [-3,-5,1,6,-7,8,11], maxdiff: " << solve(arr1) << endl;

    // Input space separated
    cout << "Enter elements separated by spaces: ";
    string spaceSeparatedInput;
    getline(cin, spaceSeparatedInput);
    vector<int> arr2;
    int num;
    stringstream ss2(spaceSeparatedInput);
    while (ss2 >> num) {
        arr2.push_back(num);
    }
    cout << "Case 2: -3 -5 1 6 -7 8 11, maxdiff: " << solveInt(arr2) << endl;

    return 0;
}


================================================
FILE: 3 May Shift 1/maximum difference between smallest and largest/code.java
================================================
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static int solve(List<String> arr) {
        int largest = Integer.MIN_VALUE;
        int maxDiff = Integer.MIN_VALUE;
        for (int i = arr.size() - 1; i >= 0; i--) {
            try {
                int num = Integer.parseInt(arr.get(i));
                largest = Math.max(largest, num);
                maxDiff = Math.max(maxDiff, largest - num);
            } catch (NumberFormatException e) {
                // Handle invalid input
                System.err.println("Invalid input: " + arr.get(i));
            }
        }
        return maxDiff;
    }

    public static int solveInt(List<Integer> arr) {
        int largest = Integer.MIN_VALUE;
        int maxDiff = Integer.MIN_VALUE;
        for (int i = arr.size() - 1; i >= 0; i--) {
            int num = arr.get(i);
            largest = Math.max(largest, num);
            maxDiff = Math.max(maxDiff, largest - num);
        }
        return maxDiff;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // Input array format
        System.out.print("Enter elements separated by commas within square brackets like [element1,element2,...]: ");
        String input = scanner.nextLine().trim();
        input = input.substring(1, input.length() - 1); // Remove square brackets
        String[] arr1 = input.split(",");
        List<String> list1 = new ArrayList<>();
        for (String s : arr1) {
            list1.add(s.trim());
        }
        System.out.println("Case 1 - [-3,-5,1,6,-7,8,11], maxdiff: " + solve(list1));

        // Input space separated
        System.out.print("Enter elements separated by spaces: ");
        String spaceSeparatedInput = scanner.nextLine().trim();
        String[] arr2 = spaceSeparatedInput.split(" ");
        List<Integer> list2 = new ArrayList<>();
        for (String s : arr2) {
            list2.add(Integer.parseInt(s));
        }
        System.out.println("Case 2: -3 -5 1 6 -7 8 11, maxdiff: SS" + solveInt(list2));

        scanner.close();
    }
}


================================================
FILE: 3 May Shift 1/maximum difference between smallest and largest/code.py
================================================
def solve(arr):
    largest, maxDiff = float('-inf'), float('-inf')
    for i in range(len(arr) - 1, -1, -1):
        num = int(arr[i])
        largest = max(largest, num)
        maxDiff = max(maxDiff, largest - num)
    return maxDiff

def solveInt(arr):
    largest, maxDiff = float('-inf'), float('-inf')
    for i in range(len(arr) - 1, -1, -1):
        num = arr[i]
        largest = max(largest, num)
        maxDiff = max(maxDiff, largest - num)
    return maxDiff

def input_array_format():
    arr = list(map(str, input().strip("[]").split(',')))
    print("\nCase 1 - [-3,-5,1,6,-7,8,11], maxdiff: ", solve(arr))

def input_space_separated():
    arr = list(map(int, input().split()))
    print("\nCase 2: -3 -5 1 6 -7 8 11, maxdiff: ", solveInt(arr))


input_array_format()
input_space_separated()

================================================
FILE: 30 APRIL SHIFT 1/GRADE Problem/code.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    vector<string> ans;
    int totalFemale = 0, totalGrade = 0;
    while(n--) {
        string name, gender;
        char grade;
        int age;
        cin >> name >> age >> grade >> gender;

        if(age > 20)
            cout << name << endl;
        
        if (gender == "Female") {
            totalFemale++;
            totalGrade += grade; 
        }
    }
    double avg = (double) (totalGrade / totalFemale);
    cout << avg << endl;
    
}

================================================
FILE: 30 APRIL SHIFT 1/GRADE Problem/code.java
================================================
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        scanner.nextLine(); // Consume newline character

        List<String> ans = new ArrayList<>();
        int totalFemale = 0;
        int totalGrade = 0;

        while (n-- > 0) {
            String name, gender;
            char grade;
            int age;

            name = scanner.next();
            age = scanner.nextInt();
            grade = scanner.next().charAt(0);
            gender = scanner.next();

            if (age > 20) {
                ans.add(name);
            }

            if (gender.equals("Female")) {
                totalFemale++;
                totalGrade += grade;
            }
        }

        for (String name : ans) {
            System.out.println(name);
        }

        double avg = totalFemale == 0 ? 0 : (double) totalGrade / totalFemale;
        System.out.println(avg);
    }
}


================================================
FILE: 30 APRIL SHIFT 1/GRADE Problem/code.py
================================================
gradeTotal, totalFemale = 0, 0
ans = []
for _ in range(int(input())):
    # name = input()
    # age = int(input())
    # grade = input()
    # gender = input()
    
    s = input()
    l = s.split(" ")
    name, age, grade, gender = l[0], int(l[1]), l[2], l[3]
    if age > 20:
        ans.append(name)
    if gender == "Female":
        gradeTotal += ord(grade)
        totalFemale += 1
    avg =  gradeTotal / totalFemale
print(*ans)
print(avg)



================================================
FILE: 30 APRIL SHIFT 1/GRADE Problem/tempCodeRunnerFile.py
================================================
3 
AAA 21 A Female 
BBB 24 B Male
CCC 26 C Female

================================================
FILE: 30 APRIL SHIFT 1/MAJORITY ELEMENT/code.cpp
================================================
#include <bits/stdc++.h>
using namespace std;

void findMajorityElement(vector<int>& arr, int N) {
    unordered_map<int, int> freq;
    for (int num : arr) {
        freq[num]++;
    }
    for (auto& pair : freq) {
        if (pair.second >= N / 2) {
            cout << pair.first << " ";
        }
    }
}

int main() {
    int N;
    cin >> N;
    vector<int> array(N);
    for (int i = 0; i < N; ++i) {
        cin >> array[i];
    }
    findMajorityElement(array, N);
    return 0;
}


================================================
FILE: 30 APRIL SHIFT 1/MAJORITY ELEMENT/code.java
================================================
import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void findMajorityElement(int[] arr, int N) {
        HashMap<Integer, Integer> freq = new HashMap<>();
        for (int num : arr) {
            freq.put(num, freq.getOrDefault(num, 0) + 1);
        }
        for (int key : freq.keySet()) {
            if (freq.get(key) >= N / 2) {
                System.out.print(key + " ");
            }
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] array = new int[N];
        for (int i = 0; i < N; ++i) {
            array[i] = scanner.nextInt();
        }
        findMajorityElement(array, N);
    }
}


================================================
FILE: 30 APRIL SHIFT 1/MAJORITY ELEMENT/code.py
================================================
def findMajorityElement(arr, N):
    freq = {}
    for num in arr:
        if num in freq:
            freq[num] += 1 
        else:
            freq[num] = 1
    for key, val in freq.items():
        if val >= N // 2:
            print(key, end = " ")
    

N = int(input())
array = list(map(int, input().split()))
findMajorityElement(array, N)

================================================
FILE: 8 MAY SHIFT 1/Nearest divisible/code.cpp
================================================
#include <iostream>
using namespace std;

int customRound(double number) {
    int integerPart = (int) number;
    double decimalPart = number - integerPart;

    if (decimalPart >= 0.5) {
        return integerPart + 1;
    } else {
        return integerPart;
    }
}

int main() {
    int x, y;
    cin >> x;
    cin >> y;

    double nearest = (double) x / y;
    int roundedNumber = customRound(nearest);
    cout << roundedNumber * y << endl;

    return 0;
}


================================================
FILE: 8 MAY SHIFT 1/Nearest divisible/code.java
================================================
import java.util.Scanner;

public class CustomRound {
    public static int customRound(double number) {
        int integerPart = (int) number;
        double decimalPart = number - integerPart;

        if (decimalPart >= 0.5) {
            return integerPart + 1;
        } else {
            return integerPart;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int y = scanner.nextInt();

        double nearest = (double) x / y;
        int roundedNumber = customRound(nearest);
        System.out.println(roundedNumber * y);
    }
}


================================================
FILE: 8 MAY SHIFT 1/Nearest divisible/code.py
================================================
def custom_round(number):
    integer_part = int(number)
    decimal_part = number - integer_part

    if decimal_part >= 0.5:
        return integer_part + 1
    else:
        return integer_part


x = int(input())
y = int(input())
nearest = x / y
rounded_number = custom_round(nearest)
print(rounded_number * y)  


================================================
FILE: 8 MAY SHIFT 1/Password creations/code.cpp
================================================
#include <iostream>
using namespace std;

string addValueToChars(string inputStr, int value) {
    string result = "";
    for (char ch : inputStr) {
        if (isalpha(ch)) {
            if (islower(ch)) {
                result += ((ch - 'a' + value) % 26) + 'a';
            } else {
                result += ((ch - 'A' + value) % 26) + 'A';
            }
        } else if (isdigit(ch)) {
            result += ((ch - '0' + value) % 10) + '0';
        } else {
            if (ch == '@') {
                result += '#';
            } else {
                result += '@';
            }
        }
    }
    return result;
}

int main() {
    string inputStr;
    int value;

    cout << "Enter input string: ";
    cin >> inputStr;
    cout << "Enter value: ";
    cin >> value;

    string outputStr = addValueToChars(inputStr, value);
    cout << "Output: " << outputStr << endl;

    return 0;
}


================================================
FILE: 8 MAY SHIFT 1/Password creations/code.java
================================================
import java.util.Scanner;

public class Main {
    public static String addValueToChars(String inputStr, int value) {
        StringBuilder result = new StringBuilder();
        for (char ch : inputStr.toCharArray()) {
            if (Character.isLetter(ch)) {
                if (Character.isLowerCase(ch)) {
                    result.append((char) (((ch - 'a' + value) % 26) + 'a'));
                } else {
                    result.append((char) (((ch - 'A' + value) % 26) + 'A'));
                }
            } else if (Character.isDigit(ch)) {
                result.append((char) (((ch - '0' + value) % 10) + '0'));
            } else {
                if (ch == '@') {
                    result.append('#');
                } else {
                    result.append('@');
                }
            }
        }
        return result.toString();
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter input string: ");
        String inputStr = scanner.next();
        System.out.print("Enter value: ");
        int value = scanner.nextInt();

        String outputStr = addValueToChars(inputStr, value);
        System.out.println("Output: " + outputStr);
    }
}


================================================
FILE: 8 MAY SHIFT 1/Password creations/code.py
================================================
def add_value_to_chars(input_str, value):
    result = ""
    for char in input_str:
        if char.isalpha():
            if char.islower():
                result += chr(((ord(char) - ord('a') + value) % 26) + ord('a'))
            else:
                result += chr(((ord(char) - ord('A') + value) % 26) + ord('A'))
        elif char.isdigit():
            result += str((int(char) + value) % 10)
        else:
            if char == '@':
                result += '#'
            else: 
                result += '@'
    return result

input_str = input()
value = int(input())

output_str = add_value_to_chars(input_str, value)
print("Output:", output_str)


================================================
FILE: 9 May 2024 Shift - 2/Print All combinations/code.cpp
================================================
#include <iostream>
#include <sstream>
#include <vector>

int main() {
    std::string input;
    std::getline(std::cin, input);
    std::istringstream iss(input);
    
    int n;
    iss >> n;
    
    std::vector<int> arr;
    int temp;
    while (iss >> temp) {
        arr.push_back(temp);
    }
    
    for (int i = 0; i < n; ++i) {
        for (int j = i; j < n; ++j) {
            for (int q = i; q <= j; ++q) {
                std::cout << arr[q];
                if (q != j)
                    std::cout << " ";
            }
            if (i != n - 1)
                std::cout << ",";
        }
    }

    return 0;
}


================================================
FILE: 9 May 2024 Shift - 2/Print All combinations/code.java
================================================
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String in = sc.nextLine();
        String[] arr = in.split(" ");
        int n = Integer.parseInt(arr[0]);
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i < arr.length; i++) {
            sb.append(arr[i]);
        }
        for (int i = 0; i < n; i++) {
            for (int j = i; j < n; j++) {
                for (int q = i; q <= j; q++) {
                    if (q != j) {
                        System.out.print(sb.charAt(q) + " ");
                    } else {
                        System.out.print(sb.charAt(q));
                    }
                }
                if (i != n - 1)
                    System.out.print(",");
            }
        }
    }
}



================================================
FILE: 9 May 2024 Shift - 2/Print All combinations/code.py
================================================
def main():
    in_str = input()
    arr = in_str.split(" ")
    n = int(arr[0])
    sb = "".join(arr[1:])
    
    for i in range(n):
        for j in range(i, n):
            for q in range(i, j + 1):
                if q != j:
                    print(sb[q], end=" ")
                else:
                    print(sb[q], end="")
            if i != n - 1:
                print(",", end="")
    print()

if __name__ == "__main__":
    main()


================================================
FILE: 9 May 2024 Shift - 2/Sort the given array asc and desc/code.cpp
================================================
#include <bits/stdc++.h>

using namespace std;

void printDictSorted(const map<string, int>& mydict, bool reverse = false) {
    vector<string> sorted_keys;
    for (const auto& entry : mydict) {
        sorted_keys.push_back(entry.first);
    }
    if (reverse) {
        sort(sorted_keys.rbegin(), sorted_keys.rend());
    } else {
        sort(sorted_keys.begin(), sorted_keys.end());
    }
    for (const string& key : sorted_keys) {
        cout << key << " ";
    }
    cout << endl;
}

int main() {
    string input;
    getline(cin, input);
    istringstream iss(input);
    vector<string> arr{istream_iterator<string>{iss}, istream_iterator<string>{}};

    map<string, int> d;
    for (const string& fruit : arr) {
        d[fruit]++;
    }

    printDictSorted(d);
    printDictSorted(d, true);

    return 0;
}


================================================
FILE: 9 May 2024 Shift - 2/Sort the given array asc and desc/code.java
================================================
import java.util.Scanner;
import java.util.HashMap;
import java.util.Map;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
    public static void printDictSorted(Map<String, Integer> mydict, boolean reverse) {
        ArrayList<String> sortedKeys = new ArrayList<>(mydict.keySet());
        if (reverse) {
            Collections.sort(sortedKeys, Collections.reverseOrder());
        } else {
            Collections.sort(sortedKeys);
        }
        for (String key : sortedKeys) {
            System.out.print(key + " ");
        }
        System.out.println();
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        String[] arr = input.split("\\s+");
        Map<String, Integer> d = new HashMap<>();
        for (String fruit : arr) {
            d.put(fruit, d.getOrDefault(fruit, 0) + 1);
        }

        printDictSorted(d, false);
        printDictSorted(d, true);
    }
}



================================================
FILE: 9 May 2024 Shift - 2/Sort the given array asc and desc/code.py
================================================
from collections import defaultdict

def printDictSorted(mydict, reverse=False):
    sorted_keys = sorted(mydict.keys(), reverse=reverse)
    for key in sorted_keys:
        print(key, end=" ")
    print()

arr = input().split()

d = defaultdict(int)
for fruit in arr:
    d[fruit] += 1

printDictSorted(d)
printDictSorted(d, reverse=True)


================================================
FILE: TCS NQT ALL INPUT scenario/Arrays 1D/code.cpp
================================================
#include <iostream>
#include <vector>
#include <sstream>
using namespace std;

vector<int> input_array_format() {
    vector<int> arr;
    string input;
    getline(cin, input);
    stringstream ss(input);
    char c;
    while (ss >> c) {
        if (c != ',' || c != '[' or c != ']') {
            int num;
            ss >> num;
            arr.push_back(num);
        }
    }
    return arr;
}

vector<int> input_space_separated() {
    vector<int> arr;
    string input;
    getline(cin, input);
    stringstream ss(input);
    int num;
    while (ss >> num) {
        arr.push_back(num);
    }
    return arr;
}

vector<int> input_comma_separated() {
    vector<int> arr;
    string input;
    getline(cin, input);
    stringstream ss(input);
    int num;
    char c;
    while (ss >> num) {
        arr.push_back(num);
        ss >> c;  // Skip the comma
    }
    return arr;
}

vector<int> input_array_size_not_given() {
    vector<int> arr;
    string input;
    getline(cin, input);
    stringstream ss(input);
    int num;
    while (ss >> num) {
        arr.push_back(num);
    }
    return arr;
}

int main() {
    // Case 1: [1,2,3,4,5]
    vector<int> arr1 = input_array_format();
    cout << "Case 1: [1,2,3,4,5]" << endl;
    for (int num : arr1) {
        cout << num << " ";
    }
    cout << endl;

    // Case 2: 1 2 3 4 5
    vector<int> arr2 = input_space_separated();
    cout << "Case 2: 1 2 3 4 5" << endl;
    for (int num : arr2) {
        cout << num << " ";
    }
    cout << endl;

    // Case 3: 1,2,3,4,5
    vector<int> arr3 = input_comma_separated();
    cout << "Case 3: 1,2,3,4,5" << endl;
    for (int num : arr3) {
        cout << num << " ";
    }
    cout << endl;

    // Case with size not given
    vector<int> arr4 = input_array_size_not_given();
    cout << "Case with size not given" << endl;
    for (int num : arr4) {
        cout << num << " ";
    }
    cout << endl;

    return 0;
}


================================================
FILE: TCS NQT ALL INPUT scenario/Arrays 1D/code.java
================================================
import java.util.ArrayList;
import java.util.Scanner;

public class InputExample {
    public static ArrayList<Integer> inputArrayFormat() {
        ArrayList<Integer> arr = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        for (char c : input.toCharArray()) {
            if (Character.isDigit(c)) {
                int num = Character.getNumericValue(c);
                arr.add(num);
            }
        }
        return arr;
    }

    public static ArrayList<Integer> inputSpaceSeparated() {
        ArrayList<Integer> arr = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        Scanner ss = new Scanner(input);
        while (ss.hasNextInt()) {
            arr.add(ss.nextInt());
        }
        return arr;
    }

    public static ArrayList<Integer> inputCommaSeparated() {
        ArrayList<Integer> arr = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        Scanner ss = new Scanner(input).useDelimiter(",");
        while (ss.hasNextInt()) {
            arr.add(ss.nextInt());
        }
        return arr;
    }

    public static ArrayList<Integer> inputArraySizeNotGiven() {
        ArrayList<Integer> arr = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        Scanner ss = new Scanner(input);
        while (ss.hasNextInt()) {
            arr.add(ss.nextInt());
        }
        return arr;
    }

    public static void main(String[] args) {
        // Case 1: [1,2,3,4,5]
        ArrayList<Integer> arr1 = inputArrayFormat();
        System.out.println("Case 1: [1,2,3,4,5]");
        for (int num : arr1) {
            System.out.print(num + " ");
        }
        System.out.println();

        // Case 2: 1 2 3 4 5
        ArrayList<Integer> arr2 = inputSpaceSeparated();
        System.out.println("Case 2: 1 2 3 4 5");
        for (int num : arr2) {
            System.out.print(num + " ");
        }
        System.out.println();

        // Case 3: 1,2,3,4,5
        ArrayList<Integer> arr3 = inputCommaSeparated();
        System.out.println("Case 3: 1,2,3,4,5");
        for (int num : arr3) {
            System.out.print(num + " ");
        }
        System.out.println();

        // Case with size not given
        ArrayList<Integer> arr4 = inputArraySizeNotGiven();
        System.out.println("Case with size not given");
        for (int num : arr4) {
            System.out.print(num + " ");
        }
        System.out.println();
    }
}


================================================
FILE: TCS NQT ALL INPUT scenario/Arrays 1D/code.py
================================================
# Case 1: [1,2,3,4,5]
def input_array_format():
    arr = list(map(int, input().strip("[]").split(',')))
    return arr

# Case 2: 1 2 3 4 5
def input_space_separated():
    arr = list(map(int, input().split()))
    return arr

# Case 3: 1,2,3,4,5
def input_comma_separated():
    arr = list(map(int, input().split(',')))
    return arr

# Case with size not given
def input_array_size_not_given():
    arr = []
    while True:
        try:
            num = input().strip()
            if num == "":
                break
            arr.extend(map(int, num.split()))
        except ValueError:
            print("Please enter valid integers separated by space.")
    return arr

def input_array_size_not_given2():
    arr = list(map(int, input().split()))
    return arr


print(input_array_format())
print(input_space_separated())
print(input_comma_separated())
print(input_array_size_not_given2())

================================================
FILE: TCS NQT ALL INPUT scenario/Strings/code.cpp
================================================
#include <iostream>
#include <vector>
#include <sstream>
using namespace std;

vector<string> input_array_format() {
    vector<string> arr;
    string input;
    getline(cin, input);
    stringstream ss(input);
    char c;
    while (ss >> c) {
        if (isalpha(c)) {
            string element;
            ss >> element;
            arr.push_back(element);
        }
    }
    return arr;
}

vector<string> input_space_separated() {
    vector<string> arr;
    string input;
    getline(cin, input);
    stringstream ss(input);
    string element;
    while (ss >> element) {
        arr.push_back(element);
    }
    return arr;
}

vector<string> input_array_size_not_given() {
    vector<string> arr;
    string input;
    cout << "Enter array elements (press Enter after each element, press Enter twice to stop):" << endl;
    while (true) {
        string element;
        getline(cin, element);
        if (element.empty()) {
            break;
        }
        arr.push_back(element);
    }
    return arr;
}

int main() {
    // Case 1: ['A', 'B', 'C', 'D']
    cout << "Case 1: ['A', 'B', 'C', 'D']" << endl;
    vector<string> arr1 = input_array_format();
    for (const string& element : arr1) {
        cout << element << " ";
    }
    cout << endl;

    // Case 2: A B C D
    cout << "Case 2: A B C D" << endl;
    vector<string> arr2 = input_space_separated();
    for (const string& element : arr2) {
        cout << element << " ";
    }
    cout << endl;

    // Case with size not given
    cout << "Case with size not given" << endl;
    vector<string> arr3 = input_array_size_not_given();
    for (const string& element : arr3) {
        cout << element << " ";
    }
    cout << endl;

    return 0;
}


================================================
FILE: TCS NQT ALL INPUT scenario/Strings/code.java
================================================
import java.util.ArrayList;
import java.util.Scanner;

public class InputExample {
    public static ArrayList<String> inputArrayFormat() {
        ArrayList<String> arr = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        for (char c : input.toCharArray()) {
            if (Character.isLetter(c)) {
                arr.add(Character.toString(c));
            }
        }
        return arr;
    }

    public static ArrayList<String> inputSpaceSeparated() {
        ArrayList<String> arr = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        Scanner ss = new Scanner(input);
        while (ss.hasNext()) {
            arr.add(ss.next());
        }
        return arr;
    }

    public static ArrayList<String> inputArraySizeNotGiven() {
        ArrayList<String> arr = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter array elements (press Enter after each element, press Enter twice to stop):");
        while (true) {
            String element = scanner.nextLine().trim();
            if (element.isEmpty()) {
                break;
            }
            arr.add(element);
        }
        return arr;
    }

    public static void main(String[] args) {
        // Case 1: ['A', 'B', 'C', 'D']
        System.out.println("Case 1: ['A', 'B', 'C', 'D']");
        System.out.println(inputArrayFormat());

        // Case 2: A B C D
        System.out.println("Case 2: A B C D");
        System.out.println(inputSpaceSeparated());

        // Case with size not given
        System.out.println("Case with size not given");
        System.out.println(inputArraySizeNotGiven());
    }
}


================================================
FILE: TCS NQT ALL INPUT scenario/Strings/code.py
================================================
def input_array_format():
    arr = list(map(str, input().strip("[]").split(',')))
    return arr

def input_space_separated():
    arr = list(map(str, input().split()))
    return arr

def input_array_size_not_given():
    arr = []
    while True:
        element = input().strip()
        if not element:
            break
        arr.append(element)
    return arr

def main():
    # Case 1: ['A', 'B', 'C', 'D']
    print("Case 1: ['A', 'B', 'C', 'D']")
    print(input_array_format())

    # Case 2: A B C D, Case with size not given
    print("Case 2: A B C D, Case with size not given")
    print(input_space_separated())

if __name__ == "__main__":
    main()
Download .txt
gitextract_1jnw95xb/

├── .vscode/
│   └── settings.json
├── 06 MAY SHIFT 1/
│   ├── MAJORITY ELEMENT/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── SORT NUMBERS/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 06 MAY SHIFT 2/
│   ├── Missing number/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── Prime number/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 08 MAY SHIFT 2/
│   ├── SequenceQuestion/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── fiveThree Program/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 09 MAY 2024 SHIFT - 1/
│   ├── Armstrong Number/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── print top K students/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 14 May Shift 1/
│   ├── Maximum Sum of Subarray/
│   │   ├── codeCpp.cpp
│   │   ├── codeJava.java
│   │   └── codePy.py
│   └── Sum of unique elements/
│       ├── codeCpp.cpp
│       ├── codeJava.java
│       └── codePy.py
├── 14 May Shift 2/
│   ├── Cost of shipping/
│   │   ├── codeCpp.cpp
│   │   ├── codeJava.java
│   │   └── codePy.py
│   └── Number of Subarray of sum of K/
│       ├── codeCpp.cpp
│       ├── codeJava.java
│       └── codePy.py
├── 26 APRIL 2024 SHIFT - 1/
│   ├── Find subarray equals to target/
│   │   ├── codeCpp.cpp
│   │   ├── codeJava.java
│   │   └── subArraySum.py
│   └── Unique Paths/
│       ├── codeCpp.cpp
│       ├── codeJava.java
│       └── uniquePaths.py
├── 26 APRIL 2024 SHIFT - 2/
│   ├── Cube sum/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── cubeSum.py
│   └── Find Most sell item-avg-totalsell/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 29 APRIL 2024 Shift - 1/
│   ├── Maximum element of subarray/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   ├── code.py
│   │   └── tempCodeRunnerFile.py
│   └── Multiplication table/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 29 APRIL SHIFT 2/
│   ├── Bit OR Sum/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── FIbonacci/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 3 May SHIFT 2/
│   ├── Maximum Efficiency/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── Pairs of shoes/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 3 May Shift 1/
│   ├── Number Divisible/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── maximum difference between smallest and largest/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 30 APRIL SHIFT 1/
│   ├── GRADE Problem/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   ├── code.py
│   │   └── tempCodeRunnerFile.py
│   └── MAJORITY ELEMENT/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 8 MAY SHIFT 1/
│   ├── Nearest divisible/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── Password creations/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
├── 9 May 2024 Shift - 2/
│   ├── Print All combinations/
│   │   ├── code.cpp
│   │   ├── code.java
│   │   └── code.py
│   └── Sort the given array asc and desc/
│       ├── code.cpp
│       ├── code.java
│       └── code.py
└── TCS NQT ALL INPUT scenario/
    ├── Arrays 1D/
    │   ├── code.cpp
    │   ├── code.java
    │   └── code.py
    └── Strings/
        ├── code.cpp
        ├── code.java
        └── code.py
Download .txt
SYMBOL INDEX (229 symbols across 88 files)

FILE: 06 MAY SHIFT 1/MAJORITY ELEMENT/code.cpp
  function findMajorityElement (line 8) | void findMajorityElement(vector<string>& arr, int N) {
  function findMajorityElementInt (line 24) | void findMajorityElementInt(vector<int>& arr, int N) {
  function input_array_format (line 40) | void input_array_format() {
  function input_space_separated (line 53) | void input_space_separated() {
  function main (line 66) | int main() {

FILE: 06 MAY SHIFT 1/MAJORITY ELEMENT/code.java
  class MajorityElement (line 4) | public class MajorityElement {
    method findMajorityElement (line 6) | public static void findMajorityElement(String[] arr, int N) {
    method findMajorityElementInt (line 22) | public static void findMajorityElementInt(int[] arr, int N) {
    method inputArrayFormat (line 38) | public static void inputArrayFormat() {
    method inputSpaceSeparated (line 46) | public static void inputSpaceSeparated() {
    method main (line 58) | public static void main(String[] args) {

FILE: 06 MAY SHIFT 1/MAJORITY ELEMENT/code.py
  function findMajorityElement (line 1) | def findMajorityElement(arr, N):
  function findMajorityElementInt (line 14) | def findMajorityElementInt(arr, N):
  function input_array_format (line 26) | def input_array_format():
  function input_space_separated (line 31) | def input_space_separated():

FILE: 06 MAY SHIFT 1/SORT NUMBERS/code.cpp
  function sortBySwap (line 6) | vector<char> sortBySwap(vector<char>& arr, int N) {
  function main (line 25) | int main() {

FILE: 06 MAY SHIFT 1/SORT NUMBERS/code.java
  class SortBySwap (line 5) | public class SortBySwap {
    method sortBySwap (line 7) | public static List<Character> sortBySwap(char[] arr, int N) {
    method main (line 34) | public static void main(String[] args) {

FILE: 06 MAY SHIFT 1/SORT NUMBERS/code.py
  function sortBySwap (line 1) | def sortBySwap(arr, N):

FILE: 06 MAY SHIFT 2/Missing number/code.cpp
  function getMissingNumIntFormat (line 7) | int getMissingNumIntFormat(vector<int>& arr, int size) {
  function getMissingNumStrFormat (line 17) | int getMissingNumStrFormat(vector<string>& arr, int size) {
  function input_space_separated (line 31) | void input_space_separated() {
  function input_array_format (line 48) | void input_array_format() {
  function main (line 63) | int main() {

FILE: 06 MAY SHIFT 2/Missing number/code.java
  class Main (line 5) | public class Main {
    method getMissingNumIntFormat (line 7) | public static int getMissingNumIntFormat(List<Integer> arr, int size) {
    method getMissingNumStrFormat (line 17) | public static int getMissingNumStrFormat(List<String> arr, int size) {
    method input_space_separated (line 28) | public static void input_space_separated() {
    method input_array_format (line 42) | public static void input_array_format() {
    method main (line 56) | public static void main(String[] args) {

FILE: 06 MAY SHIFT 2/Missing number/code.py
  function getMissingNumIntFormat (line 1) | def getMissingNumIntFormat(arr, size):
  function intFormat (line 11) | def intFormat():
  function getMissingNumStrFormat (line 16) | def getMissingNumStrFormat(arr, size):
  function strFormat (line 25) | def strFormat():

FILE: 06 MAY SHIFT 2/Prime number/code.cpp
  function isPrime (line 5) | bool isPrime(int number) {
  function calculateSum (line 27) | bool calculateSum(int n) {
  function main (line 37) | int main() {

FILE: 06 MAY SHIFT 2/Prime number/code.java
  class Main (line 3) | public class Main {
    method isPrime (line 5) | public static boolean isPrime(int number) {
    method calculateSum (line 27) | public static boolean calculateSum(int n) {
    method main (line 37) | public static void main(String[] args) {

FILE: 06 MAY SHIFT 2/Prime number/code.py
  function isPrime (line 1) | def isPrime(number):
  function calculateSum (line 15) | def calculateSum(n):

FILE: 08 MAY SHIFT 2/SequenceQuestion/code.cpp
  function is_positive_integer (line 4) | bool is_positive_integer(const string& str) {
  function generate_sequence (line 13) | vector<int> generate_sequence(int n) {
  function max_length_of_sequence_and_k (line 26) | pair<int, int> max_length_of_sequence_and_k(int n) {
  function max_sequence_value_and_k (line 39) | pair<int, int> max_sequence_value_and_k(int n) {
  function main (line 52) | int main() {

FILE: 08 MAY SHIFT 2/SequenceQuestion/code.java
  class Main (line 5) | public class Main {
    method isPositiveInteger (line 6) | public static boolean isPositiveInteger(String str) {
    method generateSequence (line 15) | public static List<Integer> generateSequence(int n) {
    method maxLengthOfSequenceAndK (line 28) | public static int[] maxLengthOfSequenceAndK(int n) {
    method maxSequenceValueAndK (line 41) | public static int[] maxSequenceValueAndK(int n) {
    method main (line 54) | public static void main(String[] args) {

FILE: 08 MAY SHIFT 2/SequenceQuestion/code.py
  function generate_sequence (line 1) | def generate_sequence(n):
  function max_length_of_sequence_and_k (line 12) | def max_length_of_sequence_and_k(n):
  function max_sequence_value_and_k (line 24) | def max_sequence_value_and_k(n):

FILE: 08 MAY SHIFT 2/fiveThree Program/code.cpp
  function solve (line 5) | void solve(vector<string>& arr) {
  function input_array_format1 (line 21) | void input_array_format1() {
  function main (line 37) | int main() {

FILE: 08 MAY SHIFT 2/fiveThree Program/code.java
  class Main (line 6) | public class Main {
    method solve (line 7) | public static String solve(List<String> arr) {
    method inputArrayFormat1 (line 24) | public static void inputArrayFormat1() {
    method main (line 39) | public static void main(String[] args) {

FILE: 08 MAY SHIFT 2/fiveThree Program/code.py
  function solve (line 1) | def solve(arr, N):
  function input_array_format1 (line 13) | def input_array_format1():

FILE: 09 MAY 2024 SHIFT - 1/Armstrong Number/code.cpp
  function isArmStrongNumber (line 8) | bool isArmStrongNumber(int n, int k) {
  function main (line 19) | int main() {

FILE: 09 MAY 2024 SHIFT - 1/Armstrong Number/code.java
  class ArmstrongNumber (line 4) | public class ArmstrongNumber {
    method isArmStrongNumber (line 5) | static boolean isArmStrongNumber(int n, int k) {
    method main (line 16) | public static void main(String[] args) {

FILE: 09 MAY 2024 SHIFT - 1/Armstrong Number/code.py
  function isArmStrongNumber (line 1) | def isArmStrongNumber(n, k):

FILE: 09 MAY 2024 SHIFT - 1/print top K students/code.cpp
  function main (line 5) | int main() {

FILE: 09 MAY 2024 SHIFT - 1/print top K students/code.java
  class Main (line 3) | public class Main {
    method main (line 4) | public static void main(String[] args) {

FILE: 14 May Shift 1/Maximum Sum of Subarray/codeCpp.cpp
  function main (line 8) | int main() {

FILE: 14 May Shift 1/Maximum Sum of Subarray/codeJava.java
  class Main (line 3) | public class Main {
    method main (line 4) | public static void main(String[] args) {

FILE: 14 May Shift 1/Sum of unique elements/codeCpp.cpp
  function main (line 8) | int main() {

FILE: 14 May Shift 1/Sum of unique elements/codeJava.java
  class Main (line 3) | public class Main {
    method main (line 4) | public static void main(String[] args) {

FILE: 14 May Shift 2/Cost of shipping/codeCpp.cpp
  function calculate_total_cost (line 3) | double calculate_total_cost(int weight, int distance) {
  function main (line 15) | int main() {

FILE: 14 May Shift 2/Cost of shipping/codeJava.java
  class Main (line 3) | public class Main {
    method calculateTotalCost (line 5) | public static double calculateTotalCost(int weight, int distance) {
    method main (line 17) | public static void main(String[] args) {

FILE: 14 May Shift 2/Cost of shipping/codePy.py
  function calculate_total_cost (line 1) | def calculate_total_cost(weight, distance):

FILE: 14 May Shift 2/Number of Subarray of sum of K/codeCpp.cpp
  function subarraySum (line 4) | int subarraySum(vector<int>& arr, int k) {
  function main (line 17) | int main() {

FILE: 14 May Shift 2/Number of Subarray of sum of K/codeJava.java
  class Main (line 3) | public class Main {
    method subarraySum (line 5) | public static int subarraySum(int[] arr, int k) {
    method main (line 20) | public static void main(String[] args) {

FILE: 14 May Shift 2/Number of Subarray of sum of K/codePy.py
  function subarray_sum (line 1) | def subarray_sum(arr, k):

FILE: 26 APRIL 2024 SHIFT - 1/Find subarray equals to target/codeCpp.cpp
  function bruteForce (line 6) | void bruteForce(vector<int>& arr, int n, int target) {
  function optimalApproach (line 21) | void optimalApproach(vector<int>& arr, int n, int target) {
  function main (line 43) | int main() {

FILE: 26 APRIL 2024 SHIFT - 1/Find subarray equals to target/codeJava.java
  class Main (line 3) | public class Main {
    method bruteForce (line 4) | static void bruteForce(int[] arr, int n, int target) {
    method optimalApproach (line 19) | static void optimalApproach(int[] arr, int n, int target) {
    method main (line 41) | public static void main(String[] args) {

FILE: 26 APRIL 2024 SHIFT - 1/Find subarray equals to target/subArraySum.py
  function bruteFroce (line 1) | def bruteFroce(arr, n, target):
  function optimalApp (line 9) | def optimalApp (arr, n, target):

FILE: 26 APRIL 2024 SHIFT - 1/Unique Paths/codeCpp.cpp
  class Solution (line 4) | class Solution {
    method f (line 6) | int f(int i, int j, vector<vector<int>> &dp){
    method uniquePaths (line 17) | int uniquePaths(int m, int n) {

FILE: 26 APRIL 2024 SHIFT - 1/Unique Paths/codeJava.java
  class Solution (line 1) | public class Solution {
    method f (line 2) | public int f(int i, int j, int[][] dp) {
    method uniquePaths (line 14) | public int uniquePaths(int m, int n) {

FILE: 26 APRIL 2024 SHIFT - 1/Unique Paths/uniquePaths.py
  class Solution (line 1) | class Solution:
    method __init__ (line 2) | def __init__(self):
    method f (line 5) | def f(self, i, j, dp):
    method uniquePaths (line 19) | def uniquePaths(self, m, n):

FILE: 26 APRIL 2024 SHIFT - 2/Cube sum/code.cpp
  function findCubeSum (line 5) | void findCubeSum(int start, int end) {
  function main (line 13) | int main() {

FILE: 26 APRIL 2024 SHIFT - 2/Cube sum/code.java
  class Main (line 3) | public class Main {
    method findCubeSum (line 4) | public static void findCubeSum(int start, int end) {
    method main (line 12) | public static void main(String[] args) {

FILE: 26 APRIL 2024 SHIFT - 2/Cube sum/cubeSum.py
  function findCubeSum (line 1) | def findCubeSum(start, end):

FILE: 26 APRIL 2024 SHIFT - 2/Find Most sell item-avg-totalsell/code.cpp
  function main (line 7) | int main() {

FILE: 26 APRIL 2024 SHIFT - 2/Find Most sell item-avg-totalsell/code.java
  class Main (line 5) | public class Main {
    method main (line 6) | public static void main(String[] args) {

FILE: 29 APRIL 2024 Shift - 1/Maximum element of subarray/code.cpp
  function solve (line 7) | void solve(vector<int>& arr, int k) {
  function optimalSolution (line 22) | void optimalSolution(vector<int>& arr, int k) {
  function main (line 44) | int main() {

FILE: 29 APRIL 2024 Shift - 1/Maximum element of subarray/code.java
  class Main (line 3) | public class Main {
    method solve (line 4) | public static void solve(ArrayList<Integer> arr, int k) {
    method optimalSolution (line 19) | public static void optimalSolution(ArrayList<Integer> arr, int k) {
    method main (line 41) | public static void main(String[] args) {

FILE: 29 APRIL 2024 Shift - 1/Maximum element of subarray/code.py
  function solve (line 2) | def solve(arr, k):
  function optimalSolution (line 11) | def optimalSolution(arr, k):

FILE: 29 APRIL 2024 Shift - 1/Multiplication table/code.cpp
  function main (line 5) | int main() {

FILE: 29 APRIL 2024 Shift - 1/Multiplication table/code.java
  class Main (line 3) | public class Main {
    method main (line 4) | public static void main(String[] args) {

FILE: 29 APRIL SHIFT 2/Bit OR Sum/code.cpp
  function subarrayBitwiseORs (line 6) | int subarrayBitwiseORs(vector<int>& arr) {
  function main (line 23) | int main() {

FILE: 29 APRIL SHIFT 2/Bit OR Sum/code.java
  class SubarrayBitwiseORs (line 3) | public class SubarrayBitwiseORs {
    method subarrayBitwiseORs (line 4) | public static int subarrayBitwiseORs(int[] arr) {
    method main (line 22) | public static void main(String[] args) {

FILE: 29 APRIL SHIFT 2/Bit OR Sum/code.py
  function subarrayBitwiseORs (line 1) | def subarrayBitwiseORs(arr):

FILE: 29 APRIL SHIFT 2/FIbonacci/code.cpp
  function fibonacci (line 4) | int fibonacci(int n) {
  function main (line 24) | int main() {

FILE: 29 APRIL SHIFT 2/FIbonacci/code.java
  class Fibonacci (line 3) | public class Fibonacci {
    method fibonacci (line 4) | public static int fibonacci(int n) {
    method main (line 23) | public static void main(String[] args) {

FILE: 29 APRIL SHIFT 2/FIbonacci/code.py
  function fibonacci (line 1) | def fibonacci(n):

FILE: 3 May SHIFT 2/Maximum Efficiency/code.cpp
  function main (line 6) | int main() {

FILE: 3 May SHIFT 2/Maximum Efficiency/code.java
  class Main (line 3) | public class Main {
    method main (line 4) | public static void main(String[] args) {

FILE: 3 May SHIFT 2/Pairs of shoes/code.cpp
  function main (line 6) | int main() {

FILE: 3 May SHIFT 2/Pairs of shoes/code.java
  class Main (line 3) | public class Main {
    method main (line 4) | public static void main(String[] args) {

FILE: 3 May Shift 1/Number Divisible/code.cpp
  function isDivisibleByNine (line 3) | bool isDivisibleByNine(int number) {
  function main (line 7) | int main() {

FILE: 3 May Shift 1/Number Divisible/code.java
  class Main (line 3) | public class Main {
    method main (line 4) | public static void main(String[] args) {

FILE: 3 May Shift 1/Number Divisible/code.py
  function check_divisibility (line 1) | def check_divisibility(number):

FILE: 3 May Shift 1/maximum difference between smallest and largest/code.cpp
  function solve (line 5) | int solve(vector<string>& arr) {
  function solveInt (line 21) | int solveInt(vector<int>& arr) {
  function main (line 32) | int main() {

FILE: 3 May Shift 1/maximum difference between smallest and largest/code.java
  class Main (line 5) | public class Main {
    method solve (line 6) | public static int solve(List<String> arr) {
    method solveInt (line 22) | public static int solveInt(List<Integer> arr) {
    method main (line 33) | public static void main(String[] args) {

FILE: 3 May Shift 1/maximum difference between smallest and largest/code.py
  function solve (line 1) | def solve(arr):
  function solveInt (line 9) | def solveInt(arr):
  function input_array_format (line 17) | def input_array_format():
  function input_space_separated (line 21) | def input_space_separated():

FILE: 30 APRIL SHIFT 1/GRADE Problem/code.cpp
  function main (line 4) | int main() {

FILE: 30 APRIL SHIFT 1/GRADE Problem/code.java
  class Main (line 5) | public class Main {
    method main (line 6) | public static void main(String[] args) {

FILE: 30 APRIL SHIFT 1/MAJORITY ELEMENT/code.cpp
  function findMajorityElement (line 4) | void findMajorityElement(vector<int>& arr, int N) {
  function main (line 16) | int main() {

FILE: 30 APRIL SHIFT 1/MAJORITY ELEMENT/code.java
  class Main (line 4) | public class Main {
    method findMajorityElement (line 5) | public static void findMajorityElement(int[] arr, int N) {
    method main (line 17) | public static void main(String[] args) {

FILE: 30 APRIL SHIFT 1/MAJORITY ELEMENT/code.py
  function findMajorityElement (line 1) | def findMajorityElement(arr, N):

FILE: 8 MAY SHIFT 1/Nearest divisible/code.cpp
  function customRound (line 4) | int customRound(double number) {
  function main (line 15) | int main() {

FILE: 8 MAY SHIFT 1/Nearest divisible/code.java
  class CustomRound (line 3) | public class CustomRound {
    method customRound (line 4) | public static int customRound(double number) {
    method main (line 15) | public static void main(String[] args) {

FILE: 8 MAY SHIFT 1/Nearest divisible/code.py
  function custom_round (line 1) | def custom_round(number):

FILE: 8 MAY SHIFT 1/Password creations/code.cpp
  function string (line 4) | string addValueToChars(string inputStr, int value) {
  function main (line 26) | int main() {

FILE: 8 MAY SHIFT 1/Password creations/code.java
  class Main (line 3) | public class Main {
    method addValueToChars (line 4) | public static String addValueToChars(String inputStr, int value) {
    method main (line 26) | public static void main(String[] args) {

FILE: 8 MAY SHIFT 1/Password creations/code.py
  function add_value_to_chars (line 1) | def add_value_to_chars(input_str, value):

FILE: 9 May 2024 Shift - 2/Print All combinations/code.cpp
  function main (line 5) | int main() {

FILE: 9 May 2024 Shift - 2/Print All combinations/code.java
  class Main (line 3) | public class Main {
    method main (line 4) | public static void main(String[] args) {

FILE: 9 May 2024 Shift - 2/Print All combinations/code.py
  function main (line 1) | def main():

FILE: 9 May 2024 Shift - 2/Sort the given array asc and desc/code.cpp
  function printDictSorted (line 5) | void printDictSorted(const map<string, int>& mydict, bool reverse = fals...
  function main (line 21) | int main() {

FILE: 9 May 2024 Shift - 2/Sort the given array asc and desc/code.java
  class Main (line 7) | public class Main {
    method printDictSorted (line 8) | public static void printDictSorted(Map<String, Integer> mydict, boolea...
    method main (line 21) | public static void main(String[] args) {

FILE: 9 May 2024 Shift - 2/Sort the given array asc and desc/code.py
  function printDictSorted (line 3) | def printDictSorted(mydict, reverse=False):

FILE: TCS NQT ALL INPUT scenario/Arrays 1D/code.cpp
  function input_array_format (line 6) | vector<int> input_array_format() {
  function input_space_separated (line 22) | vector<int> input_space_separated() {
  function input_comma_separated (line 34) | vector<int> input_comma_separated() {
  function input_array_size_not_given (line 48) | vector<int> input_array_size_not_given() {
  function main (line 60) | int main() {

FILE: TCS NQT ALL INPUT scenario/Arrays 1D/code.java
  class InputExample (line 4) | public class InputExample {
    method inputArrayFormat (line 5) | public static ArrayList<Integer> inputArrayFormat() {
    method inputSpaceSeparated (line 18) | public static ArrayList<Integer> inputSpaceSeparated() {
    method inputCommaSeparated (line 29) | public static ArrayList<Integer> inputCommaSeparated() {
    method inputArraySizeNotGiven (line 40) | public static ArrayList<Integer> inputArraySizeNotGiven() {
    method main (line 51) | public static void main(String[] args) {

FILE: TCS NQT ALL INPUT scenario/Arrays 1D/code.py
  function input_array_format (line 2) | def input_array_format():
  function input_space_separated (line 7) | def input_space_separated():
  function input_comma_separated (line 12) | def input_comma_separated():
  function input_array_size_not_given (line 17) | def input_array_size_not_given():
  function input_array_size_not_given2 (line 29) | def input_array_size_not_given2():

FILE: TCS NQT ALL INPUT scenario/Strings/code.cpp
  function input_array_format (line 6) | vector<string> input_array_format() {
  function input_space_separated (line 22) | vector<string> input_space_separated() {
  function input_array_size_not_given (line 34) | vector<string> input_array_size_not_given() {
  function main (line 49) | int main() {

FILE: TCS NQT ALL INPUT scenario/Strings/code.java
  class InputExample (line 4) | public class InputExample {
    method inputArrayFormat (line 5) | public static ArrayList<String> inputArrayFormat() {
    method inputSpaceSeparated (line 17) | public static ArrayList<String> inputSpaceSeparated() {
    method inputArraySizeNotGiven (line 28) | public static ArrayList<String> inputArraySizeNotGiven() {
    method main (line 42) | public static void main(String[] args) {

FILE: TCS NQT ALL INPUT scenario/Strings/code.py
  function input_array_format (line 1) | def input_array_format():
  function input_space_separated (line 5) | def input_space_separated():
  function input_array_size_not_given (line 9) | def input_array_size_not_given():
  function main (line 18) | def main():
Condensed preview — 99 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (97K chars).
[
  {
    "path": ".vscode/settings.json",
    "chars": 1925,
    "preview": "{\n    \"files.associations\": {\n        \"ostream\": \"cpp\",\n        \"array\": \"cpp\",\n        \"atomic\": \"cpp\",\n        \"*.tcc\""
  },
  {
    "path": "06 MAY SHIFT 1/MAJORITY ELEMENT/code.cpp",
    "chars": 1528,
    "preview": "#include <iostream>\n#include <unordered_map>\n#include <vector>\n#include <sstream>\n\nusing namespace std;\n\nvoid findMajori"
  },
  {
    "path": "06 MAY SHIFT 1/MAJORITY ELEMENT/code.java",
    "chars": 1952,
    "preview": "import java.util.HashMap;\nimport java.util.Scanner;\n\npublic class MajorityElement {\n\n    public static void findMajority"
  },
  {
    "path": "06 MAY SHIFT 1/MAJORITY ELEMENT/code.py",
    "chars": 879,
    "preview": "def findMajorityElement(arr, N):\n    freq = {}\n    for n in arr:\n        num = int(n)\n        if num in freq:\n          "
  },
  {
    "path": "06 MAY SHIFT 1/SORT NUMBERS/code.cpp",
    "chars": 762,
    "preview": "#include <iostream>\n#include <vector>\n\nusing namespace std;\n\nvector<char> sortBySwap(vector<char>& arr, int N) {\n    int"
  },
  {
    "path": "06 MAY SHIFT 1/SORT NUMBERS/code.java",
    "chars": 1281,
    "preview": "import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class SortBySwap {\n\n    public stat"
  },
  {
    "path": "06 MAY SHIFT 1/SORT NUMBERS/code.py",
    "chars": 506,
    "preview": "def sortBySwap(arr, N):\n    left = 0\n    mid = 0 \n    right = N - 1 \n    while mid <= right:\n        if arr[mid] == '3':"
  },
  {
    "path": "06 MAY SHIFT 2/Missing number/code.cpp",
    "chars": 1459,
    "preview": "#include <iostream>\n#include <vector>\n#include <sstream>\n\nusing namespace std;\n\nint getMissingNumIntFormat(vector<int>& "
  },
  {
    "path": "06 MAY SHIFT 2/Missing number/code.java",
    "chars": 1936,
    "preview": "import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n\n    public static int"
  },
  {
    "path": "06 MAY SHIFT 2/Missing number/code.py",
    "chars": 692,
    "preview": "def getMissingNumIntFormat(arr, size):\n    totalSum = 0\n    n = size + 1\n    for num in arr:\n        totalSum += num \n  "
  },
  {
    "path": "06 MAY SHIFT 2/Prime number/code.cpp",
    "chars": 933,
    "preview": "#include <iostream>\n\nusing namespace std;\n\nbool isPrime(int number) {\n    if (number <= 1) {  // 1 and below are not pri"
  },
  {
    "path": "06 MAY SHIFT 2/Prime number/code.java",
    "chars": 1224,
    "preview": "import java.util.Scanner;\n\npublic class Main {\n\n    public static boolean isPrime(int number) {\n        if (number <= 1)"
  },
  {
    "path": "06 MAY SHIFT 2/Prime number/code.py",
    "chars": 620,
    "preview": "def isPrime(number):\n    if number <= 1: \n        return False\n    if number <= 3:\n        return True\n    if number % 2"
  },
  {
    "path": "08 MAY SHIFT 2/SequenceQuestion/code.cpp",
    "chars": 1979,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n\nbool is_positive_integer(const string& str) {\n    for (char c : str) {\n  "
  },
  {
    "path": "08 MAY SHIFT 2/SequenceQuestion/code.java",
    "chars": 2521,
    "preview": "import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n    public static bool"
  },
  {
    "path": "08 MAY SHIFT 2/SequenceQuestion/code.py",
    "chars": 1089,
    "preview": "def generate_sequence(n):\n    sequence = [n]\n    while n != 1:\n        if n % 2 == 0:\n            n //= 2\n        else:\n"
  },
  {
    "path": "08 MAY SHIFT 2/fiveThree Program/code.cpp",
    "chars": 1007,
    "preview": "#include <bits/stdc++.h>\n\nusing namespace std;\n\nvoid solve(vector<string>& arr) {\n    stringstream result;\n    for (auto"
  },
  {
    "path": "08 MAY SHIFT 2/fiveThree Program/code.java",
    "chars": 1349,
    "preview": "import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\nimport java.util.StringJoiner;\n\npublic clas"
  },
  {
    "path": "08 MAY SHIFT 2/fiveThree Program/code.py",
    "chars": 458,
    "preview": "def solve(arr, N):\n    result = []\n    for num in arr:\n        if num % 3 == 0 and num % 5 == 0:\n            print(\"Thre"
  },
  {
    "path": "09 MAY 2024 SHIFT - 1/Armstrong Number/code.cpp",
    "chars": 967,
    "preview": "#include <iostream>\n#include <vector>\n#include <string>\n#include <cmath>\n\nusing namespace std;\n\nbool isArmStrongNumber(i"
  },
  {
    "path": "09 MAY 2024 SHIFT - 1/Armstrong Number/code.java",
    "chars": 1169,
    "preview": "import java.util.Scanner;\nimport java.util.ArrayList;\n\npublic class ArmstrongNumber {\n    static boolean isArmStrongNumb"
  },
  {
    "path": "09 MAY 2024 SHIFT - 1/Armstrong Number/code.py",
    "chars": 522,
    "preview": "def isArmStrongNumber(n, k):\n    sum = 0\n    originalNum = n\n    while originalNum > 0:\n        digit = originalNum % 10"
  },
  {
    "path": "09 MAY 2024 SHIFT - 1/print top K students/code.cpp",
    "chars": 684,
    "preview": "#include <bits/stdc++.h>\n\nusing namespace std;\n\nint main() {\n    string s;\n    getline(cin, s);\n    vector<string> l;\n  "
  },
  {
    "path": "09 MAY 2024 SHIFT - 1/print top K students/code.java",
    "chars": 1022,
    "preview": "import java.util.*;\n\npublic class Main {\n    public static void main(String[] args) {\n        Scanner scanner = new Scan"
  },
  {
    "path": "09 MAY 2024 SHIFT - 1/print top K students/code.py",
    "chars": 318,
    "preview": "s = input()\nl = s.split()\nk, N = int(l[0]), int(l[1])\narr = []\nfor i in range(2, len(l), 2):\n    marks, name = int(l[i])"
  },
  {
    "path": "14 May Shift 1/Maximum Sum of Subarray/codeCpp.cpp",
    "chars": 613,
    "preview": "#include <iostream>\n#include <vector>\n#include <algorithm>\n#include <sstream>\n\nusing namespace std;\n\nint main() {\n    st"
  },
  {
    "path": "14 May Shift 1/Maximum Sum of Subarray/codeJava.java",
    "chars": 739,
    "preview": "import java.util.Scanner;\n\npublic class Main {\n    public static void main(String[] args) {\n        Scanner scanner = ne"
  },
  {
    "path": "14 May Shift 1/Maximum Sum of Subarray/codePy.py",
    "chars": 252,
    "preview": "nums = list(map(int, input().split()))\nmaxSum = nums[0]\ncurrentSum = 0\nfor i in range(len(nums)):\n    currentSum += nums"
  },
  {
    "path": "14 May Shift 1/Sum of unique elements/codeCpp.cpp",
    "chars": 643,
    "preview": "#include <iostream>\n#include <unordered_map>\n#include <vector>\n#include <sstream>\n\nusing namespace std;\n\nint main() {\n  "
  },
  {
    "path": "14 May Shift 1/Sum of unique elements/codeJava.java",
    "chars": 775,
    "preview": "import java.util.*;\n\npublic class Main {\n    public static void main(String[] args) {\n        Scanner scanner = new Scan"
  },
  {
    "path": "14 May Shift 1/Sum of unique elements/codePy.py",
    "chars": 225,
    "preview": "nums = list(map(int, input().split()))\nd = {}\nfor i in range(len(nums)):\n    if nums[i] not in d:\n        d[nums[i]] = 1"
  },
  {
    "path": "14 May Shift 2/Cost of shipping/codeCpp.cpp",
    "chars": 682,
    "preview": "#include <bits/stdc++.h>\n\ndouble calculate_total_cost(int weight, int distance) {\n    double base_money = 5.00;\n    doub"
  },
  {
    "path": "14 May Shift 2/Cost of shipping/codeJava.java",
    "chars": 806,
    "preview": "import java.util.Scanner;\n\npublic class Main {\n    \n    public static double calculateTotalCost(int weight, int distance"
  },
  {
    "path": "14 May Shift 2/Cost of shipping/codePy.py",
    "chars": 428,
    "preview": "def calculate_total_cost(weight, distance):\n    base_money = 5.00\n    cost_per_kg = 2.00\n    cost_per_10_km = 0.50\n    \n"
  },
  {
    "path": "14 May Shift 2/Number of Subarray of sum of K/codeCpp.cpp",
    "chars": 655,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n\nint subarraySum(vector<int>& arr, int k) {\n    unordered_map<int, int> mp"
  },
  {
    "path": "14 May Shift 2/Number of Subarray of sum of K/codeJava.java",
    "chars": 975,
    "preview": "import java.util.*;\n\npublic class Main {\n\n    public static int subarraySum(int[] arr, int k) {\n        Map<Integer, Int"
  },
  {
    "path": "14 May Shift 2/Number of Subarray of sum of K/codePy.py",
    "chars": 347,
    "preview": "def subarray_sum(arr, k):\n    mpp = {0: 1}\n    pre_sum = 0\n    cnt = 0\n    \n    for num in arr:\n        pre_sum += num\n "
  },
  {
    "path": "26 APRIL 2024 SHIFT - 1/Find subarray equals to target/codeCpp.cpp",
    "chars": 1269,
    "preview": "#include <iostream>\n#include <vector>\n#include <unordered_map>\nusing namespace std;\n\nvoid bruteForce(vector<int>& arr, i"
  },
  {
    "path": "26 APRIL 2024 SHIFT - 1/Find subarray equals to target/codeJava.java",
    "chars": 1474,
    "preview": "import java.util.HashMap;\n\npublic class Main {\n    static void bruteForce(int[] arr, int n, int target) {\n        for (i"
  },
  {
    "path": "26 APRIL 2024 SHIFT - 1/Find subarray equals to target/subArraySum.py",
    "chars": 679,
    "preview": "def bruteFroce(arr, n, target):\n    for i in range(n):\n        curSum = 0\n        for j in range(i, n):\n            curS"
  },
  {
    "path": "26 APRIL 2024 SHIFT - 1/Unique Paths/codeCpp.cpp",
    "chars": 494,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n\nclass Solution {\nprivate:\n    int f(int i, int j, vector<vector<int>> &dp"
  },
  {
    "path": "26 APRIL 2024 SHIFT - 1/Unique Paths/codeJava.java",
    "chars": 584,
    "preview": "public class Solution {\n    public int f(int i, int j, int[][] dp) {\n        if (i == 0 && j == 0) return 1;\n        if "
  },
  {
    "path": "26 APRIL 2024 SHIFT - 1/Unique Paths/uniquePaths.py",
    "chars": 480,
    "preview": "class Solution:\n    def __init__(self):\n        pass\n    \n    def f(self, i, j, dp):\n        if i == 0 and j == 0:\n     "
  },
  {
    "path": "26 APRIL 2024 SHIFT - 2/Cube sum/code.cpp",
    "chars": 315,
    "preview": "#include <iostream>\n\nusing namespace std;\n\nvoid findCubeSum(int start, int end) {\n    int cubeSum = 0;\n    for (int i = "
  },
  {
    "path": "26 APRIL 2024 SHIFT - 2/Cube sum/code.java",
    "chars": 504,
    "preview": "import java.util.Scanner;\n\npublic class Main {\n    public static void findCubeSum(int start, int end) {\n        int cube"
  },
  {
    "path": "26 APRIL 2024 SHIFT - 2/Cube sum/cubeSum.py",
    "chars": 245,
    "preview": "def findCubeSum(start, end):\n    cubeSum = 0\n    for i in range(start, end+1):\n        cubeSum += i ** 3 # i * i * i \n  "
  },
  {
    "path": "26 APRIL 2024 SHIFT - 2/Find Most sell item-avg-totalsell/code.cpp",
    "chars": 1328,
    "preview": "#include <iostream>\n#include <string>\n#include <map>\n\nusing namespace std;\n\nint main() {\n    int n;\n    cin >> n;\n\n    /"
  },
  {
    "path": "26 APRIL 2024 SHIFT - 2/Find Most sell item-avg-totalsell/code.java",
    "chars": 1691,
    "preview": "import java.util.HashMap;\nimport java.util.Map;\nimport java.util.Scanner;\n\npublic class Main {\n    public static void ma"
  },
  {
    "path": "26 APRIL 2024 SHIFT - 2/Find Most sell item-avg-totalsell/code.py",
    "chars": 839,
    "preview": "n = int(input())\nmaxCost = 0\nmaxCostItem = \"\"\ntotalPrice = 0\navg = 0\nfor i in range(n):\n    item = input()\n    quantity "
  },
  {
    "path": "29 APRIL 2024 Shift - 1/Maximum element of subarray/code.cpp",
    "chars": 1193,
    "preview": "#include <iostream>\n#include <vector>\n#include <queue>\n\nusing namespace std;\n\nvoid solve(vector<int>& arr, int k) {\n    "
  },
  {
    "path": "29 APRIL 2024 Shift - 1/Maximum element of subarray/code.java",
    "chars": 1772,
    "preview": "import java.util.*;\n\npublic class Main {\n    public static void solve(ArrayList<Integer> arr, int k) {\n        ArrayList"
  },
  {
    "path": "29 APRIL 2024 Shift - 1/Maximum element of subarray/code.py",
    "chars": 659,
    "preview": "import heapq\ndef solve(arr, k):\n    ans = []\n    for i in range(len(arr) - k + 1):\n        maxi = arr[i]\n        for j i"
  },
  {
    "path": "29 APRIL 2024 Shift - 1/Maximum element of subarray/tempCodeRunnerFile.py",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "29 APRIL 2024 Shift - 1/Multiplication table/code.cpp",
    "chars": 205,
    "preview": "#include <iostream>\n\nusing namespace std;\n\nint main() {\n    int n;\n    cin >> n;\n    int mSum = 0;\n    for (int i = 1; i"
  },
  {
    "path": "29 APRIL 2024 Shift - 1/Multiplication table/code.java",
    "chars": 317,
    "preview": "import java.util.Scanner;\n\npublic class Main {\n    public static void main(String[] args) {\n        Scanner scanner = ne"
  },
  {
    "path": "29 APRIL 2024 Shift - 1/Multiplication table/code.py",
    "chars": 80,
    "preview": "n = int(input())\nmSum = 0\nfor i in range(1, n+1):\n    mSum += n * i \nprint(mSum)"
  },
  {
    "path": "29 APRIL SHIFT 2/Bit OR Sum/code.cpp",
    "chars": 716,
    "preview": "#include <iostream>\n#include <vector>\n#include <unordered_set>\nusing namespace std;\n\nint subarrayBitwiseORs(vector<int>&"
  },
  {
    "path": "29 APRIL SHIFT 2/Bit OR Sum/code.java",
    "chars": 954,
    "preview": "import java.util.*;\n\npublic class SubarrayBitwiseORs {\n    public static int subarrayBitwiseORs(int[] arr) {\n        Lis"
  },
  {
    "path": "29 APRIL SHIFT 2/Bit OR Sum/code.py",
    "chars": 378,
    "preview": "def subarrayBitwiseORs(arr):\n    res = []\n    left = 0\n    for num in arr:\n        right = len(res)\n        res.append(n"
  },
  {
    "path": "29 APRIL SHIFT 2/FIbonacci/code.cpp",
    "chars": 556,
    "preview": "#include <iostream>\nusing namespace std;\n\nint fibonacci(int n) {\n    int a = 0, b = 1, sum=1;\n    if (n < 0) {\n        c"
  },
  {
    "path": "29 APRIL SHIFT 2/FIbonacci/code.java",
    "chars": 743,
    "preview": "import java.util.Scanner;\n\npublic class Fibonacci {\n    public static int fibonacci(int n) {\n        int a = 0, b = 1;\n "
  },
  {
    "path": "29 APRIL SHIFT 2/FIbonacci/code.py",
    "chars": 326,
    "preview": "def fibonacci(n):\n    prev2, prev = 0, 1\n    if n == 0:\n        return prev2 \n    if n == 1:\n        return prev \n    fi"
  },
  {
    "path": "3 May SHIFT 2/Maximum Efficiency/code.cpp",
    "chars": 491,
    "preview": "#include <iostream>\n#include <vector>\n#include <algorithm>\nusing namespace std;\n\nint main() {\n    int N;\n    cin >> N;\n "
  },
  {
    "path": "3 May SHIFT 2/Maximum Efficiency/code.java",
    "chars": 600,
    "preview": "import java.util.*;\n\npublic class Main {\n    public static void main(String[] args) {\n        Scanner scanner = new Scan"
  },
  {
    "path": "3 May SHIFT 2/Maximum Efficiency/code.py",
    "chars": 223,
    "preview": "N = int(input())\narr = list(map(int, input().split()))\narr.sort()\n\n#Max values\nemp1 = arr[N-1]\nemp2 = arr[N-2]\nemp3 = ar"
  },
  {
    "path": "3 May SHIFT 2/Pairs of shoes/code.cpp",
    "chars": 882,
    "preview": "#include <iostream>\n#include <unordered_map>\n#include <string>\nusing namespace std;\n\nint main() {\n    int N;\n    cin >> "
  },
  {
    "path": "3 May SHIFT 2/Pairs of shoes/code.java",
    "chars": 1042,
    "preview": "import java.util.*;\n\npublic class Main {\n    public static void main(String[] args) {\n        Scanner scanner = new Scan"
  },
  {
    "path": "3 May SHIFT 2/Pairs of shoes/code.py",
    "chars": 477,
    "preview": "N = int(input())\nl = list(map(str, input().split()))\nstore = {}\nfor shoeSize in l:\n    if shoeSize in store:\n        sto"
  },
  {
    "path": "3 May Shift 1/Number Divisible/code.cpp",
    "chars": 445,
    "preview": "#include <iostream>\n\nbool isDivisibleByNine(int number) {\n    return number % 9 == 0;\n}\n\nint main() {\n    int number;\n  "
  },
  {
    "path": "3 May Shift 1/Number Divisible/code.java",
    "chars": 478,
    "preview": "import java.util.Scanner;\n\npublic class Main {\n    public static void main(String[] args) {\n        Scanner scanner = ne"
  },
  {
    "path": "3 May Shift 1/Number Divisible/code.py",
    "chars": 299,
    "preview": "def check_divisibility(number):\n    if 100 <= number <= 999:\n        if number % 9 == 0:\n            print(f\"Number {num"
  },
  {
    "path": "3 May Shift 1/maximum difference between smallest and largest/code.cpp",
    "chars": 1764,
    "preview": "#include <bits/stdc++.h>\n\nusing namespace std;\n\nint solve(vector<string>& arr) {\n    int largest = INT_MIN;\n    int maxD"
  },
  {
    "path": "3 May Shift 1/maximum difference between smallest and largest/code.java",
    "chars": 2142,
    "preview": "import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n    public static int "
  },
  {
    "path": "3 May Shift 1/maximum difference between smallest and largest/code.py",
    "chars": 809,
    "preview": "def solve(arr):\n    largest, maxDiff = float('-inf'), float('-inf')\n    for i in range(len(arr) - 1, -1, -1):\n        nu"
  },
  {
    "path": "30 APRIL SHIFT 1/GRADE Problem/code.cpp",
    "chars": 527,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n    int n;\n    vector<string> ans;\n    int totalFemale = 0, "
  },
  {
    "path": "30 APRIL SHIFT 1/GRADE Problem/code.java",
    "chars": 1065,
    "preview": "import java.util.ArrayList;\nimport java.util.List;\nimport java.util.Scanner;\n\npublic class Main {\n    public static void"
  },
  {
    "path": "30 APRIL SHIFT 1/GRADE Problem/code.py",
    "chars": 449,
    "preview": "gradeTotal, totalFemale = 0, 0\nans = []\nfor _ in range(int(input())):\n    # name = input()\n    # age = int(input())\n    "
  },
  {
    "path": "30 APRIL SHIFT 1/GRADE Problem/tempCodeRunnerFile.py",
    "chars": 49,
    "preview": "3 \nAAA 21 A Female \nBBB 24 B Male\nCCC 26 C Female"
  },
  {
    "path": "30 APRIL SHIFT 1/MAJORITY ELEMENT/code.cpp",
    "chars": 490,
    "preview": "#include <bits/stdc++.h>\nusing namespace std;\n\nvoid findMajorityElement(vector<int>& arr, int N) {\n    unordered_map<int"
  },
  {
    "path": "30 APRIL SHIFT 1/MAJORITY ELEMENT/code.java",
    "chars": 751,
    "preview": "import java.util.HashMap;\nimport java.util.Scanner;\n\npublic class Main {\n    public static void findMajorityElement(int["
  },
  {
    "path": "30 APRIL SHIFT 1/MAJORITY ELEMENT/code.py",
    "chars": 345,
    "preview": "def findMajorityElement(arr, N):\n    freq = {}\n    for num in arr:\n        if num in freq:\n            freq[num] += 1 \n "
  },
  {
    "path": "8 MAY SHIFT 1/Nearest divisible/code.cpp",
    "chars": 466,
    "preview": "#include <iostream>\nusing namespace std;\n\nint customRound(double number) {\n    int integerPart = (int) number;\n    doubl"
  },
  {
    "path": "8 MAY SHIFT 1/Nearest divisible/code.java",
    "chars": 645,
    "preview": "import java.util.Scanner;\n\npublic class CustomRound {\n    public static int customRound(double number) {\n        int int"
  },
  {
    "path": "8 MAY SHIFT 1/Nearest divisible/code.py",
    "chars": 316,
    "preview": "def custom_round(number):\n    integer_part = int(number)\n    decimal_part = number - integer_part\n\n    if decimal_part >"
  },
  {
    "path": "8 MAY SHIFT 1/Password creations/code.cpp",
    "chars": 905,
    "preview": "#include <iostream>\nusing namespace std;\n\nstring addValueToChars(string inputStr, int value) {\n    string result = \"\";\n "
  },
  {
    "path": "8 MAY SHIFT 1/Password creations/code.java",
    "chars": 1262,
    "preview": "import java.util.Scanner;\n\npublic class Main {\n    public static String addValueToChars(String inputStr, int value) {\n  "
  },
  {
    "path": "8 MAY SHIFT 1/Password creations/code.py",
    "chars": 663,
    "preview": "def add_value_to_chars(input_str, value):\n    result = \"\"\n    for char in input_str:\n        if char.isalpha():\n        "
  },
  {
    "path": "9 May 2024 Shift - 2/Print All combinations/code.cpp",
    "chars": 632,
    "preview": "#include <iostream>\n#include <sstream>\n#include <vector>\n\nint main() {\n    std::string input;\n    std::getline(std::cin,"
  },
  {
    "path": "9 May 2024 Shift - 2/Print All combinations/code.java",
    "chars": 844,
    "preview": "import java.util.Scanner;\n\npublic class Main {\n    public static void main(String[] args) {\n        Scanner sc = new Sca"
  },
  {
    "path": "9 May 2024 Shift - 2/Print All combinations/code.py",
    "chars": 448,
    "preview": "def main():\n    in_str = input()\n    arr = in_str.split(\" \")\n    n = int(arr[0])\n    sb = \"\".join(arr[1:])\n    \n    for "
  },
  {
    "path": "9 May 2024 Shift - 2/Sort the given array asc and desc/code.cpp",
    "chars": 823,
    "preview": "#include <bits/stdc++.h>\n\nusing namespace std;\n\nvoid printDictSorted(const map<string, int>& mydict, bool reverse = fals"
  },
  {
    "path": "9 May 2024 Shift - 2/Sort the given array asc and desc/code.java",
    "chars": 1015,
    "preview": "import java.util.Scanner;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.ArrayList;\nimport java.util.C"
  },
  {
    "path": "9 May 2024 Shift - 2/Sort the given array asc and desc/code.py",
    "chars": 340,
    "preview": "from collections import defaultdict\n\ndef printDictSorted(mydict, reverse=False):\n    sorted_keys = sorted(mydict.keys(),"
  },
  {
    "path": "TCS NQT ALL INPUT scenario/Arrays 1D/code.cpp",
    "chars": 1937,
    "preview": "#include <iostream>\n#include <vector>\n#include <sstream>\nusing namespace std;\n\nvector<int> input_array_format() {\n    ve"
  },
  {
    "path": "TCS NQT ALL INPUT scenario/Arrays 1D/code.java",
    "chars": 2650,
    "preview": "import java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class InputExample {\n    public static ArrayList<Integer> "
  },
  {
    "path": "TCS NQT ALL INPUT scenario/Arrays 1D/code.py",
    "chars": 901,
    "preview": "# Case 1: [1,2,3,4,5]\ndef input_array_format():\n    arr = list(map(int, input().strip(\"[]\").split(',')))\n    return arr\n"
  },
  {
    "path": "TCS NQT ALL INPUT scenario/Strings/code.cpp",
    "chars": 1731,
    "preview": "#include <iostream>\n#include <vector>\n#include <sstream>\nusing namespace std;\n\nvector<string> input_array_format() {\n   "
  },
  {
    "path": "TCS NQT ALL INPUT scenario/Strings/code.java",
    "chars": 1785,
    "preview": "import java.util.ArrayList;\nimport java.util.Scanner;\n\npublic class InputExample {\n    public static ArrayList<String> i"
  },
  {
    "path": "TCS NQT ALL INPUT scenario/Strings/code.py",
    "chars": 668,
    "preview": "def input_array_format():\n    arr = list(map(str, input().strip(\"[]\").split(',')))\n    return arr\n\ndef input_space_separ"
  }
]

About this extraction

This page contains the full source code of the Aditya-Mishra19/TCS-NQT-2024-Coding-Solutions GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 99 files (83.1 KB), approximately 25.9k tokens, and a symbol index with 229 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!