Sum of twos and threes
Your task
Count the ordered ways to write a non-negative integer n as a sum of parts where every part is 2 or 3. Order matters: 2+3 and 3+2 are different. Return the count; return 1 for n = 0 (the empty sum) and 0 when no such sum exists (for example n = 1). For example, n = 5 has two ways (2+3 and 3+2), and n = 7 has three (2+2+3, 2+3+2, 3+2+2).
Examples
count_two_three_sums(n: int) -> intExample 1
Input
count_two_three_sums(5)Output
2Example 2
Input
count_two_three_sums(7)Output
3