Help me in solving BUYORDEREZ problem

My issue

for the test case N=2 B = [0,1] the order of items [2,1] gives us 3 items but the test cases say 2 how?

My code

# cook your dish here

Problem Link: Buying Order (Easy) Practice Coding Problem