You are given a viewer's age, the day of the week, and the seat type. Your task is to calculate the final movie ticket price by applying the appropriate discounts to the base price.
The base ticket prices are as follows:
The discounts are applied as follows:
Input: age = 30, day = Saturday, seat = regular
Output: 150
Explanation: No discount applies to an adult on a weekend, so the ticket price remains ₹150.
Input: age = 10, day = Monday, seat = regular
Output: 108
Explanation: The child discount reduces the price from ₹150 to ₹120. The additional 10% weekday discount reduces it to ₹108.
Input: age = 65, day = Sunday, seat = premium
Output: 200
Explanation: The senior discount reduces the premium ticket price from ₹250 to ₹200. No weekday discount applies on Sunday.
Approach, complexity and clean code in every language. Sign in to unlock the editorial.
Your submissions, results and runtime history live here. Sign in to start your streak.
10 Monday Regular
108
25 Tuesday Regular
135