Apply Discount to Cart
Medium📝 Description
Apply a discount percentage to the total cart value.
Input Format
[ {"name": "Shirt", "price": 20}, {"name": "Jeans", "price": 50} ], discount=10
Output Format
63.0
Constraints
0 ≤ discount ≤ 100
🔍 Sample Input
[ {"name": "Shirt", "price": 20}, {"name": "Jeans", "price": 50} ], 10
✅ Sample Output
63.0
Code Editor
Please login to run and submit code.
Results
Suggested Solution
Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run