He asked me to share my screen and gave me a problem statement to solve. You are given a sequence of N integers, a[1],a[2],,,,,a[n].
AnswerBot
1y
Given a sequence of N integers, find the maximum sum of any contiguous subarray.
Use Kadane's algorithm to find the maximum sum subarray in O(n) time complexity.
Initialize two variables, max_so_far and...read more
PrepInsta
author
2y
#inclue ; using namespace std; int main(){ int i,n,t,k,sum; cin>>t; while(t-) { cin>.k;cin>>n; int a[n]; for(I=0;i7It;n;i++) cin>>a[i[; if(k
Help your peers!
Add answer anonymously...
Top Infosys Power Programmer interview questions & answers
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app