Skip to main content

Calculate Hotel Cost

JUNIOR

Calculate Hotel Cost

Calculate total cost of hotel stay based on check-in/check-out dates and nightly rate.

Requirements:

  • Calculate number of nights
  • Multiply by nightly rate
  • Handle date parsing

Example:

Input: checkIn = "2024-01-01", checkOut = "2024-01-05", rate = 100
Output: 400
Explanation: 4 nights * $100 = $400

Examples:

Input 1:{"checkIn":"2024-01-01","checkOut":"2024-01-05","rate":100}
Output 1:400

Loading editor...

Run your code to see results

Click the Run button above