en
Feedback

Don't get caught by a cheater! Telemetrio finds and tags such channels πŸ‘‰ If you want to see the tag, subscribe

Coding Solutions Group

Coding Solutions Group

Open in Telegram

Show more
IndiaThe category is not specified
2 051
Subscribers
No data24 hours
No data7 days
No data30 days
Posts Archive
Lohith [821298134] is sending a spam message. β€’ Warns now: (3/3) ❕ β€’ Action: Muted πŸ”‡

Ys

Make any basic project

Nooo

Photo from gayatri

Goat, world renowned, array of A to N elements Plzzzzz

Hi h Join Our Channel for daily Off-Campus Job Updates ❀️ πŸ‘‡πŸ‘‡ @offcampusjobs_0 @offcampusjobs_0

anyone can send today's question with answers.. pdd

Fast

Ans broo

Ans plz

Submit it

int solution(int n,int k,int[][] inp) { int i=0; int result=0; while(i+k-1 ts=new TreeSet(); int ct=k; int ind=i; int sec_sum=Integer.MAX_VALUE; while(ct-->0) { ts.add(inp[ind][0]); sec_sum=Math.min(sec_sum,inp[ind][1]); ind++; } int first_sum=0; int trav1=0,trav2=k-1; while(trav1<=trav2) { if(trav1==trav2) { first_sum=first_sum+ts.first(); break; } first_sum=first_sum+ts.last(); first_sum=first_sum-ts.first(); trav1++;trav2--; ts.pollFirst();ts.pollLast(); } result=Math.max(result,first_sum*sec_sum); i++; } return result; }