I have a new problem in my code I never seen before | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I have a new problem in my code I never seen before

https://code.sololearn.com/c1g5EIRUj9Uy/?ref=app Do I need to optimise it, and, if yes, then how? If the problem was not caused by the optimisation issues, then, what do I have to do?

9th Nov 2021, 7:47 AM
SelfyTheMentalist
SelfyTheMentalist - avatar
3 Answers
+ 1
I tryed input: 5 1 5 Output gives 0, but no error.
9th Nov 2021, 8:27 AM
Coding Cat
Coding Cat - avatar
+ 1
Martin Taylor well, it is a question for my exam, I have to write code. The numbers in the first line are s = sum of coins we need, n = number of elements in array of the coins. Each coin has its number, it can't be less than 0 or larger than 2*10⁶ , well, we have to sort them, and say, how many ways are here to have the number of s, where s=a[x]+a[y]
9th Nov 2021, 10:57 AM
SelfyTheMentalist
SelfyTheMentalist - avatar
0
Coding Cat sorry, I forgot to type the input/output 1 attempt: 4 5 2 2 3 2 1 2 (but it cause error) 2 attempt: 5 3 5 4 1 1 3 attempt: 4 3 5 0 5 no output
9th Nov 2021, 8:32 AM
SelfyTheMentalist
SelfyTheMentalist - avatar