No testcase is running pls check
pls help no ta is replying
it has been 2 days but no t.a is replying
pls help no ta is replying
Your logic is fine, it’s just that you aren’t taking input in the correct manner.
You are taking the value array in input first and then weight array, but check the input format you need to take input for weight array first and then value array.
PS: Test your code for sample input first before submitting 