Please help me how to input elements as per test cases for finding abs of them | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please help me how to input elements as per test cases for finding abs of them

https://www.codechef.com/FEB21C/problems/MAXFUN https://code.sololearn.com/cVce61ek02WB/?ref=app

8th Feb 2021, 1:51 PM
Perplexed Coder
Perplexed Coder - avatar
9 Answers
+ 4
Roy Kapoor if anything doesn't makes sense let me know , although you could just use array to insert values first into array and do summing and abs() thing which i think would be more readable and easy to do. https://code.sololearn.com/cxol2NYmF5M5/?ref=app
8th Feb 2021, 2:20 PM
Abhay
Abhay - avatar
+ 3
Thanks for helping bro you are the best😊 My doubt is why their is a condition called k<=j-2.. I understand k part is for input.. Also the statement j=k..
8th Feb 2021, 2:29 PM
Perplexed Coder
Perplexed Coder - avatar
+ 2
Experts Abhay, Ipang Please help..
8th Feb 2021, 1:54 PM
Perplexed Coder
Perplexed Coder - avatar
+ 2
@Roy Kapoor i modified it a bit , so let me know if you don't understand it.
8th Feb 2021, 2:38 PM
Abhay
Abhay - avatar
+ 2
Yes bro thanks a lot🤩
8th Feb 2021, 2:41 PM
Perplexed Coder
Perplexed Coder - avatar
+ 2
Bro a small help I need..I covered edge cases but also failing 😓 https://www.sololearn.com/post/926108/?ref=app
8th Feb 2021, 2:46 PM
Perplexed Coder
Perplexed Coder - avatar
+ 1
Experts Arsenic help please
9th Feb 2021, 5:53 PM
Perplexed Coder
Perplexed Coder - avatar
+ 1
Roy Kapoor the question you are trying to solve is from an ongoing competition (codechef's Feb long challange) I can't provide you with any solution right now as it would be considered as cheating. I would be glad to help you but only after the competition gets finished.
10th Feb 2021, 12:32 AM
Arsenic
Arsenic - avatar
+ 1
But I didn't participate
10th Feb 2021, 4:25 AM
Perplexed Coder
Perplexed Coder - avatar