Sample test case is wrong or confusing so please dont waste ur tim


#1

Comment body goes here.


#2

It’s not wrong.
If a element is present ‘n’ times in the input array , then it can be used at max ‘n’ times to calculate the sum (not infinitely).


#3

Please don’t mislead other people.
testcases are fine. There is problem in your code or your approach.