allcoding1
27.7K subscribers
2.2K photos
2 videos
74 files
850 links
Download Telegram
🎯Johnson Controls Off Campus Drive 2024 Hiring As Graduate Engineering Trainee | INR 4-6 LPA


Job Role Graduate Engineer Trainee
Qualification B.E/B.Tech
Batch 2023
Experience Freshers
Salary Rs 4-6 LPA
Job Location Pune

Apply Now:- https://www.allcoding1.com/2024/05/johnson-controls-off-campus-drive-2024.html

Telegram:- @allcoding1
1🥰1
Cognizant Careers Off Campus Drive 2024 | Programmer Analyst Trainee | Apply Now


Company Name Cognizant
Post Name Programmer Analyst Trainee
Qualification BE, B Tech, BSC, BCA, ME, M Tech & MCA
Branch Any Branches
Batch 2019, 2020, 2021, 2022, 2023 & 2024
Salary Up to ₹3.5 LPA
Experience Fresher
Job Location Bangalore, Chennai & Kolkata
Last Date Asap
Required Qualification:-
BE, B Tech, BSC, BCA, ME, M Tech & MCA

Apply Now:- https://www.allcoding1.com/2024/05/cognizant-off-campus-drive-2024.html

Telegram:- @allcoding1
👍10
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>

using namespace std;

int minimum_energy_cost_recursive(int index,int idxy, int left_consecutive, int right_consecutive, int N, int X, int Y, int El, int Er, vector<int>& weights) {
    // Base case: if we have reached the end of bags
    if (index > idxy) {
        return 0;
    }
   
    // Calculate the cost of picking from the left and the right
    int cost_left = weights[index] * X + (left_consecutive ? El : 0) +
                    minimum_energy_cost_recursive(index + 1,idxy, 1, 0, N, X, Y, El, Er, weights);
    int cost_right = weights[idxy] * Y + (right_consecutive ? Er : 0) +
                     minimum_energy_cost_recursive(index ,idxy-1, 0, 1, N, X, Y, El, Er, weights);
   
    // Return the minimum of both choices
    return min(cost_left, cost_right);
}

int main() {
    int N, X, Y, El, Er;
    cin >> N >> X >> Y >> El >> Er;
   
    vector<int> weights(N);
    for (int i = 0; i < N; ++i) {
        cin >> weights[i];
    }
   
    cout << minimum_energy_cost_recursive(0,N-1, 0, 0, N, X, Y, El, Er, weights) << endl;
   
    return 0;
}

Amazon Hackon exam
👍6🤯1
def count_arrays(N, K, X):
    MOD = 1000000007
   
    if N == 1:
        return 1 if X == 1 else 0

    a = [0] * (N + 1)
    b = [0] * (N + 1)
   
    a[1] = 1
    b[1] = 0
   
    for i in range(2, N + 1):
        a[i] = (a[i - 1] * (K - 2) + b[i - 1] * (K - 1)) % MOD
        b[i] = a[i - 1] % MOD
   
    return b[N]


N = int(input())
K = int(input())
X = int(input())
print(count_arrays(N, K, X))


Number Of Array code

Thoughtwork exam
Python3

Telegram:- @allcoding1
👍5👎2🔥1
Thoughtwork exam
Python3

Telegram:- @allcoding1
👍3
Dark lane

Thoughtwork exam
Python3

Telegram:- @allcoding1
Well growing crops

Thoughtwork exam
Python3

Telegram:- @allcoding1
Prime partition

Thoughtwork exam
Python3

Telegram:- @allcoding1
👍1
Dark lane

Thoughtwork exam
Python3

Telegram:- @allcoding1
👍1
Count children

Thoughtwork exam
Python3

Telegram:- @allcoding1
👍5
👍3