Tap here to switch tabs
Problem
Submissions

Problem: Library Late Fee Calculator

med
30 min
Try to solve the Library Late Fee Calculator problem.

Statement

You are given an integer array daysLate, where daysLate[i] denotes the number of days the iextthi^{ ext{th}} book is overdue.

The penalty for each book is calculated as follows:

  • If daysLate[i] is equal to 11, the penalty is 1imes1 imes daysLate[i].

  • If daysLate[i] is between 22 and 55 inclusive, the penalty is 2imes2 imes daysLate[i].

  • If daysLate[i] is strictly greater than 55, the penalty is 3imes3 imes daysLate[i].

Return the total penalty for all overdue books.

Constraints:

  • 1≤1 \leq daysLate.length ≤100\leq 100

  • 1≤1 \leq daysLate[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Library Late Fee Calculator

med
30 min
Try to solve the Library Late Fee Calculator problem.

Statement

You are given an integer array daysLate, where daysLate[i] denotes the number of days the iextthi^{ ext{th}} book is overdue.

The penalty for each book is calculated as follows:

  • If daysLate[i] is equal to 11, the penalty is 1imes1 imes daysLate[i].

  • If daysLate[i] is between 22 and 55 inclusive, the penalty is 2imes2 imes daysLate[i].

  • If daysLate[i] is strictly greater than 55, the penalty is 3imes3 imes daysLate[i].

Return the total penalty for all overdue books.

Constraints:

  • 1≤1 \leq daysLate.length ≤100\leq 100

  • 1≤1 \leq daysLate[i] ≤100\leq 100