← Back to challenges

Wash Your Hands :)

JavaScriptHardnumbersmath

Instructions

It takes 21 seconds to wash your hands and help prevent the spread of COVID-19.

Create a function that takes the number of times a person washes their hands per day N and the number of months they follow this routine nM and calculates the duration in minutes and seconds that person spends washing their hands.

Examples

washHands(8, 7) ➞ "588 minutes and 0 seconds"

washHands(0, 0) ➞ "0 minutes and 0 seconds"

washHands(7, 9) ➞ "661 minutes and 30 seconds"

Notes

  • Consider a month has 30 days.
  • Wash your hands.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Box Completely Filled?