Shopping Total
prices[i] is the price of item i and counts[i] is how many of it you buy. Return the total cost of the whole basket as an int.
Example 1
prices [3,10]
counts [2,1]
returns 16
3 * 2 + 10 * 1 = 16.
Constraints
1 <= len(prices) = len(counts) <= 50
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Side by Side ColumnsBeginner
- Sign of EachBeginner
- Sorted DistinctBeginner
- Standard DeviationBeginner
- Swap Rows and ColumnsBeginner
- Third QuartileBeginner
- Votes TallyBeginner
- Add Column OffsetsEasy