*π¨π₯ INFOSYS ASPIRANTS β DON'T MISS THIS! π₯π¨*
β Plagiarism-Free & Verified Codes
β Latest Exam Updates
β Instant Support
π² Join Our WhatsApp Group Now!
π https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
β‘ Share this with your friends who are writing the Infosys assessment.
π Stay Updated. Stay Ahead.
β Plagiarism-Free & Verified Codes
β Latest Exam Updates
β Instant Support
π² Join Our WhatsApp Group Now!
π https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
β‘ Share this with your friends who are writing the Infosys assessment.
π Stay Updated. Stay Ahead.
π¨ NUMBER OF WAYS β VERIFIED CODE π¨
β 100% Working Solution
π― All Test Cases Passed
β‘ Dynamic Programming Approach
π₯ Clean & Optimized Code
MOD = 1000000007
n = int(raw_input())
dp = [[0] * 5 for _ in range(n + 1)]
if n >= 1:
dp[1][1] = 1
if n >= 3:
dp[3][3] = 1
if n >= 4:
dp[4][4] = 1
nums = [1, 3, 4]
for s in range(1, n + 1):
for cur in nums:
if s >= cur:
prev_sum = s - cur
if prev_sum == 0:
continue
total = 0
for prev in nums:
if prev != cur:
total = (total + dp[prev_sum][prev]) % MOD
dp[s][cur] = (dp[s][cur] + total) % MOD
ans = (dp[n][1] + dp[n][3] + dp[n][4]) % MOD
print ans
π’ For More Verified Coding Solutions & Placement Updates:
π https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
π Share this with your friends preparing for coding assessments! π
β 100% Working Solution
π― All Test Cases Passed
β‘ Dynamic Programming Approach
π₯ Clean & Optimized Code
MOD = 1000000007
n = int(raw_input())
dp = [[0] * 5 for _ in range(n + 1)]
if n >= 1:
dp[1][1] = 1
if n >= 3:
dp[3][3] = 1
if n >= 4:
dp[4][4] = 1
nums = [1, 3, 4]
for s in range(1, n + 1):
for cur in nums:
if s >= cur:
prev_sum = s - cur
if prev_sum == 0:
continue
total = 0
for prev in nums:
if prev != cur:
total = (total + dp[prev_sum][prev]) % MOD
dp[s][cur] = (dp[s][cur] + total) % MOD
ans = (dp[n][1] + dp[n][3] + dp[n][4]) % MOD
print ans
π’ For More Verified Coding Solutions & Placement Updates:
π https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
π Share this with your friends preparing for coding assessments! π
π¨ Another Infosys 10:00 AM Slot Successfully Completed! β π―
Need Placement Support or Exam Help? DM @Mrtrueliving_ix π©π₯
π¨ Another Infosys 10:00 AM Slot Successfully Completed! β π―
Need Placement Support or Exam Help? DM @Mrtrueliving_ix π©π₯
Infosys off campus β€οΈ
π― 7/7 Slots Successfully Completed β
Need Placement Support, Online Assessment Help, or Exam Assistance?
π© DM: @Mrtrueliving_ix
π₯ Limited slots available for upcoming exams!
β 10:00 AM INFOSYS SLOT COMPLETED WITH 100% SUCCESS! π―π₯
π― 7/7 Slots Successfully Completed β
Need Placement Support, Online Assessment Help, or Exam Assistance?
π© DM: @Mrtrueliving_ix
π₯ Limited slots available for upcoming exams!
π¨ WE'RE BACK! π¨
π₯ @Mrtrueliving_ix is now back!
Need help with Placements, Online Assessments, Technical Interviews, HR Interviews, or Hiring Process Guidance?
π© Kindly coordinate with us:
π @Mrtrueliving_ix
π @Mrtrueliving_09
β‘ Reach out early to avoid last-minute rush!
π₯ @Mrtrueliving_ix is now back!
Need help with Placements, Online Assessments, Technical Interviews, HR Interviews, or Hiring Process Guidance?
π© Kindly coordinate with us:
π @Mrtrueliving_ix
π @Mrtrueliving_09
β‘ Reach out early to avoid last-minute rush!
β€2
π¨ INFOSYS 2:00 PM SLOTS AVAILABLE π¨
β³ Limited 2:00 PM exam slots are available.
π© Kindly contact now to coordinate.
π @Mrtrueliving_ix @Mrtrueliving_09
β‘ First come, first served. Contact as early as possible!
β³ Limited 2:00 PM exam slots are available.
π© Kindly contact now to coordinate.
π @Mrtrueliving_ix @Mrtrueliving_09
β‘ First come, first served. Contact as early as possible!
π¨ INFOSYS ASSESSMENT UPDATE π¨
Haven't received your assessment link? No worries! β
You can still access your exam using the common assessment portal.
π Steps to Access:
1οΈβ£ Open the assessment portal.
2οΈβ£ Log in with your registered email ID.
3οΈβ£ Click "Reset Password" and create a new password.
4οΈβ£ Log in again using your new password.
5οΈβ£ Your assessment will be availableβno separate exam link is required.
π Assessment Portal:
https://rec-test.infosys.com/iwa-web/en/login?redirect=/iwa-web/en
β οΈ Log in a few minutes early and verify your access before the exam starts.
All the Best! ππ
@Mrtrueliving_ix
@Mrtrueliving_ix
Haven't received your assessment link? No worries! β
You can still access your exam using the common assessment portal.
π Steps to Access:
1οΈβ£ Open the assessment portal.
2οΈβ£ Log in with your registered email ID.
3οΈβ£ Click "Reset Password" and create a new password.
4οΈβ£ Log in again using your new password.
5οΈβ£ Your assessment will be availableβno separate exam link is required.
π Assessment Portal:
https://rec-test.infosys.com/iwa-web/en/login?redirect=/iwa-web/en
β οΈ Log in a few minutes early and verify your access before the exam starts.
All the Best! ππ
@Mrtrueliving_ix
@Mrtrueliving_ix
β€1
*Finall call for INFOSYS 2pm slot*
Even if you haven't received your 2:00 PM Infosys login credentials, we'll help you access your assessment.
@Mrtrueliving_ix
@Mrtrueliving_ix
9030793510
9030793510
β 2: 00 PM INFOSYS SLOT COMPLETED WITH 100% SUCCESS! π―π₯
Need Placement Support, Online Assessment Help, or Exam Assistance?
π© DM: @Mrtrueliving_ix
π₯ Limited slots available for upcoming exams!
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
List<Integer> input = new ArrayList<>();
String line;
while ((line = br.readLine()) != null) {
StringTokenizer st = new StringTokenizer(line);
while (st.hasMoreTokens()) {
input.add(Integer.parseInt(st.nextToken()));
}
}
if (input.isEmpty()) return;
int idx = 0;
int N = input.get(idx++);
int K = input.get(idx++);
int L = input.get(idx++);
int M = input.get(idx++);
int[] A = new int[N];
for (int i = 0; i < N; i++) {
A[i] = input.get(idx++);
}
int numSubarrays = N - L + 1;
long[] stdSum = new long[numSubarrays];
long[] altSum = new long[numSubarrays];
for (int i = 0; i < numSubarrays; i++) {
long sVal = 0;
long aVal = 0;
int sign = 1;
for (int j = 0; j < L; j++) {
int val = A[i + j];
sVal += val;
aVal += sign * val;
sign *= -1;
}
stdSum[i] = sVal;
altSum[i] = aVal;
}
long NEG = Long.MIN_VALUE / 4;
long[][][] dp = new long[N + 1][K + 1][M + 1];
for (int i = 0; i <= N; i++) {
for (int k = 0; k <= K; k++) {
Arrays.fill(dp[i][k], NEG);
}
}
dp[0][0][0] = 0;
for (int i = 0; i < N; i++) {
for (int k = 0; k <= K; k++) {
for (int m = 0; m <= M; m++) {
if (dp[i][k][m] == NEG) continue;
dp[i + 1][k][m] = Math.max(dp[i + 1][k][m], dp[i][k][m]);
if (k < K && i + L <= N) {
dp[i + L][k + 1][m] = Math.max(
dp[i + L][k + 1][m],
dp[i][k][m] + stdSum[i]
);
if (m < M) {
dp[i + L][k + 1][m + 1] = Math.max(
dp[i + L][k + 1][m + 1],
dp[i][k][m] + altSum[i]
);
}
}
}
}
}
long ans = NEG;
for (int m = 0; m <= M; m++) {
ans = Math.max(ans, dp[N][K][m]);
}
System.out.println(ans);
}
} maximum sum of k non
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
List<Integer> input = new ArrayList<>();
String line;
while ((line = br.readLine()) != null) {
StringTokenizer st = new StringTokenizer(line);
while (st.hasMoreTokens()) {
input.add(Integer.parseInt(st.nextToken()));
}
}
if (input.isEmpty()) return;
int idx = 0;
int N = input.get(idx++);
int K = input.get(idx++);
int L = input.get(idx++);
int M = input.get(idx++);
int[] A = new int[N];
for (int i = 0; i < N; i++) {
A[i] = input.get(idx++);
}
int numSubarrays = N - L + 1;
long[] stdSum = new long[numSubarrays];
long[] altSum = new long[numSubarrays];
for (int i = 0; i < numSubarrays; i++) {
long sVal = 0;
long aVal = 0;
int sign = 1;
for (int j = 0; j < L; j++) {
int val = A[i + j];
sVal += val;
aVal += sign * val;
sign *= -1;
}
stdSum[i] = sVal;
altSum[i] = aVal;
}
long NEG = Long.MIN_VALUE / 4;
long[][][] dp = new long[N + 1][K + 1][M + 1];
for (int i = 0; i <= N; i++) {
for (int k = 0; k <= K; k++) {
Arrays.fill(dp[i][k], NEG);
}
}
dp[0][0][0] = 0;
for (int i = 0; i < N; i++) {
for (int k = 0; k <= K; k++) {
for (int m = 0; m <= M; m++) {
if (dp[i][k][m] == NEG) continue;
dp[i + 1][k][m] = Math.max(dp[i + 1][k][m], dp[i][k][m]);
if (k < K && i + L <= N) {
dp[i + L][k + 1][m] = Math.max(
dp[i + L][k + 1][m],
dp[i][k][m] + stdSum[i]
);
if (m < M) {
dp[i + L][k + 1][m + 1] = Math.max(
dp[i + L][k + 1][m + 1],
dp[i][k][m] + altSum[i]
);
}
}
}
}
}
long ans = NEG;
for (int m = 0; m <= M; m++) {
ans = Math.max(ans, dp[N][K][m]);
}
System.out.println(ans);
}
} maximum sum of k non
β€2
π Minimum Cost for Tickets β Python Solution Executed π―β
from bisect import bisect_left
m = int(raw_input())
days = list(map(int, raw_input().split()))
cost = list(map(int, raw_input().split()))
dp = {}
def solve(i, t):
if i == m:
return 0
if (i, t) in dp:
return dp[(i, t)]
ans = cost[0] + solve(i + 1, t)
if t:
ans = min(ans, solve(i + 1, t - 1))
j = bisect_left(days, days[i] + 7)
ans = min(ans, cost[1] + solve(j, t + 1))
j = bisect_left(days, days[i] + 30)
ans = min(ans, cost[2] + solve(j, t + 2))
dp[(i, t)] = ans
return ans
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
print(solve(0, 0))
π WhatsApp Channel: https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
β Stay connected & share with your friends for more coding solutions, OA updates, and placement support!
from bisect import bisect_left
m = int(raw_input())
days = list(map(int, raw_input().split()))
cost = list(map(int, raw_input().split()))
dp = {}
def solve(i, t):
if i == m:
return 0
if (i, t) in dp:
return dp[(i, t)]
ans = cost[0] + solve(i + 1, t)
if t:
ans = min(ans, solve(i + 1, t - 1))
j = bisect_left(days, days[i] + 7)
ans = min(ans, cost[1] + solve(j, t + 1))
j = bisect_left(days, days[i] + 30)
ans = min(ans, cost[2] + solve(j, t + 2))
dp[(i, t)] = ans
return ans
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
print(solve(0, 0))
π WhatsApp Channel: https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
β Stay connected & share with your friends for more coding solutions, OA updates, and placement support!
π¨ 100% TEST CASES PASSED β
π₯
π Minimum Number of Operations to Form Target Array β C++ Solution Available π―
β‘ Optimized Approach
β All Test Cases Passed
π OA Ready Code
π» Clean & Efficient Implementation
#include <bits/stdc++.h>
using namespace std;
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
long long solve(int N, vector<int>& target) {
long long total = 0;
for (int i = 0; i < N; i++) total += target[i];
long long sumX = 0;
long long carry = 0;
for (int i = 0; i + 1 < N; i++) {
long long cap = min((long long)target[i] - carry,
(long long)target[i + 1]);
if (cap < 0) cap = 0;
sumX += cap;
carry = cap;
}
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
return total - sumX;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
vector<int> target(N);
for (int i = 0; i < N; i++)
cin >> target[i];
cout << solve(N, target) << '\n';
return 0;
}
π WhatsApp Channel: https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
β Join Now for Daily OA Solutions, Placement Updates & Interview Support! π
π Minimum Number of Operations to Form Target Array β C++ Solution Available π―
β‘ Optimized Approach
β All Test Cases Passed
π OA Ready Code
π» Clean & Efficient Implementation
#include <bits/stdc++.h>
using namespace std;
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
long long solve(int N, vector<int>& target) {
long long total = 0;
for (int i = 0; i < N; i++) total += target[i];
long long sumX = 0;
long long carry = 0;
for (int i = 0; i + 1 < N; i++) {
long long cap = min((long long)target[i] - carry,
(long long)target[i + 1]);
if (cap < 0) cap = 0;
sumX += cap;
carry = cap;
}
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
return total - sumX;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
vector<int> target(N);
for (int i = 0; i < N; i++)
cin >> target[i];
cout << solve(N, target) << '\n';
return 0;
}
π WhatsApp Channel: https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
β Join Now for Daily OA Solutions, Placement Updates & Interview Support! π
π Thermostat Schedule β C++ Solution Executed π―β
π₯ 100% Test Cases Passed
β‘ Optimized O(N) Solution
π» Clean & OA Ready Code
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
if (!(cin >> N)) return 0;
vector<long long> t(N);
for (int i = 0; i < N; ++i)
cin >> t[i];
bool is_sorted = true;
for (int i = 0; i < N - 1; ++i) {
if (t[i] > t[i + 1]) {
is_sorted = false;
break;
}
}
if (is_sorted) {
long long total_sum = 0;
for (long long x : t)
total_sum += x;
cout << 0 << "\n" << total_sum << "\n";
return 0;
}
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
vector<long long> suffix_min(N);
suffix_min[N - 1] = t[N - 1];
for (int i = N - 2; i >= 0; --i)
suffix_min[i] = min(t[i], suffix_min[i + 1]);
long long max_sum = 0;
long long prefix_sum = 0;
for (int i = 0; i < N; ++i) {
long long prev = (i == 0 ? 0 : t[i - 1]);
long long val = suffix_min[i];
if (val >= prev) {
long long cur = prefix_sum + 1LL * (N - i) * val;
max_sum = max(max_sum, cur);
}
if (i < N - 1 && t[i] > t[i + 1])
break;
prefix_sum += t[i];
}
cout << 1 << "\n" << max_sum << "\n";
return 0;
}
π© DM: @Mrtrueliving_ix
π 9030793510
π WhatsApp Channel: https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
β Stay connected & share with your friends for more OA coding solutions, interview questions, and placement updates! π
π₯ 100% Test Cases Passed
β‘ Optimized O(N) Solution
π» Clean & OA Ready Code
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
if (!(cin >> N)) return 0;
vector<long long> t(N);
for (int i = 0; i < N; ++i)
cin >> t[i];
bool is_sorted = true;
for (int i = 0; i < N - 1; ++i) {
if (t[i] > t[i + 1]) {
is_sorted = false;
break;
}
}
if (is_sorted) {
long long total_sum = 0;
for (long long x : t)
total_sum += x;
cout << 0 << "\n" << total_sum << "\n";
return 0;
}
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
vector<long long> suffix_min(N);
suffix_min[N - 1] = t[N - 1];
for (int i = N - 2; i >= 0; --i)
suffix_min[i] = min(t[i], suffix_min[i + 1]);
long long max_sum = 0;
long long prefix_sum = 0;
for (int i = 0; i < N; ++i) {
long long prev = (i == 0 ? 0 : t[i - 1]);
long long val = suffix_min[i];
if (val >= prev) {
long long cur = prefix_sum + 1LL * (N - i) * val;
max_sum = max(max_sum, cur);
}
if (i < N - 1 && t[i] > t[i + 1])
break;
prefix_sum += t[i];
}
cout << 1 << "\n" << max_sum << "\n";
return 0;
}
π© DM: @Mrtrueliving_ix
π 9030793510
π WhatsApp Channel: https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
β Stay connected & share with your friends for more OA coding solutions, interview questions, and placement updates! π
β€1
π¨ Important Update for Infosys Candidates
Those who missed their assessment due to login issues or other technical problems may receive a new assessment date.
π© Kindly check your registered email regularly for any updates or rescheduling information.
If you're facing any issues, feel free to contact us:
@Mrtrueliving_ix
@Mrtrueliving_09
π 9030793510
β οΈ Keep checking your inbox and spam folder. Don't miss the update!
Those who missed their assessment due to login issues or other technical problems may receive a new assessment date.
π© Kindly check your registered email regularly for any updates or rescheduling information.
If you're facing any issues, feel free to contact us:
@Mrtrueliving_ix
@Mrtrueliving_09
π 9030793510
β οΈ Keep checking your inbox and spam folder. Don't miss the update!
*FINAL CALL β INFOSYS Exam Help*
*Those who want HELP to CLEAR the INFOSYS Assessment, contact us now! β *
π Available Slots: βͺοΈ 10:00 AM βͺοΈ 2:00 PM
*β οΈ Last Few Slots Remaining!*
π© DM Contact: @Mrtrueliving_ix // @Mrtrueliving_09
9030793510 // 9030793510
*Those who want HELP to CLEAR the INFOSYS Assessment, contact us now! β *
π Available Slots: βͺοΈ 10:00 AM βͺοΈ 2:00 PM
*β οΈ Last Few Slots Remaining!*
π© DM Contact: @Mrtrueliving_ix // @Mrtrueliving_09
9030793510 // 9030793510
π Infosys 10:00 AM Exam Help Completed Successfully! β
π― 100% accurate execution with plagiarism-free coding support.
Need help with:
β’ Placement Tests
β’ Technical Interviews
β’ Coding Questions
β’ OA Preparation
π© DM for Placement & Interview Help
π© DM for Coding Support
π @Mrtrueliving_ix
π¨π₯ INFOSYS 10:00 AM SLOT β COMPLETED! π₯π¨
β ALL 10:00 AM SLOTS ARE DONE π―
β‘ Plagiarism-Free Coding Support
β‘ High Execution Accuracy
β‘ OA β’ Coding β’ Technical Interview Assistance
π― Next Slot? Be Ready Before the Exam Starts!
π© DM NOW
π @Mrtrueliving_ix
Fast Response β’ Limited Support Slots π
Infosys 2 pm Slots are Available now
π1
N = int(raw_input())
K = int(raw_input())
prices = map(int, raw_input().split())
dp = [0] * N
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
for j in range(N):
if j > 0:
dp[j] = dp[j - 1]
if j >= K:
dp[j] = max(dp[j], dp[j - K] + prices[j] - prices[j - K])
print(max(dp) if N else 0)
ββββββββββββββββββββββββββββββ
π₯ FREE OA CODE DROP π₯
ββββββββββββββββββββββββββββββ
π Problem: Best Time to Buy & Sell Stock II
β Plagiarism-Free Solution
β Optimized & Submission Ready
β Suitable for OA & Coding Assessments
ββββββββββββββββββββββ
π’ Don't keep it to yourself!
π Forward this post to your friends and placement groups.
Helping one candidate today could help them land a job tomorrow. β€οΈ
π² Join our FREE WhatsApp Channel
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
π Daily OA Codes β’ Interview Questions β’ Placement Updates β’ Job Alerts
K = int(raw_input())
prices = map(int, raw_input().split())
dp = [0] * N
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
for j in range(N):
if j > 0:
dp[j] = dp[j - 1]
if j >= K:
dp[j] = max(dp[j], dp[j - K] + prices[j] - prices[j - K])
print(max(dp) if N else 0)
ββββββββββββββββββββββββββββββ
π₯ FREE OA CODE DROP π₯
ββββββββββββββββββββββββββββββ
π Problem: Best Time to Buy & Sell Stock II
β Plagiarism-Free Solution
β Optimized & Submission Ready
β Suitable for OA & Coding Assessments
ββββββββββββββββββββββ
π’ Don't keep it to yourself!
π Forward this post to your friends and placement groups.
Helping one candidate today could help them land a job tomorrow. β€οΈ
π² Join our FREE WhatsApp Channel
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g
π Daily OA Codes β’ Interview Questions β’ Placement Updates β’ Job Alerts