Maximum Number That Sum of the Prices Is Less Than or Equal to K
Total prices grow monotonically, so binary search the largest number, counting set bits per position with a closed formula.
Total prices grow monotonically, so binary search the largest number, counting set bits per position with a closed formula.