https://www.codewars.com/kata/5ce9c1000bab0b001134f5af
Codewars - Achieve mastery through coding practice and developer mentorship
A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!
www.codewars.com
DESCRIPTION:
Given a month as an integer from 1 to 12, return to which quarter of the year it belongs as an integer number.
For example: month 2 (February), is part of the first quarter; month 6 (June), is part of the second quarter; and month 11 (November), is part of the fourth quarter.
Constraint:
- 1 <= month <= 12
코드
const quarterOf = (month) => {
return Math.ceil(month / 3);
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Testing 1-2-3 (7 kyu) / JavaScript (0) | 2023.02.08 |
---|---|
[Codewars] The highest profit wins! (7 kyu) / JavaScript (0) | 2023.02.07 |
[Codewars] Plural (8 kyu) / JavaScript (0) | 2023.02.05 |
[Codewars] Will there be enough space? (8 kyu) / JavaScript (0) | 2023.02.04 |
[Codewars] Simple Fun #176: Reverse Letter (7 kyu) / JavaScript (0) | 2023.02.03 |
댓글