Previous multiple of three | 7 kyu Kata Í javascript

Опубликовано: 17 Июль 2026
на канале: BINARY LIFE 1100
27
0

Previous multiple of three | 7 kyu Kata Í javascript
🅺🅰🆃🅰: https://www.codewars.com/kata/61123a6...

🅳🅴🆂🅲🆁🅸🅿🆃🅸🅾🅽 :
Given a positive integer n: remove the last digit until you're left with a number that is a multiple of three.

Return n if the input is already a multiple of three, and if no such number exists, return null, a similar empty value, or -1.

Examples
1 = null
25 = null
36 = 36
1244 = 12
952406 = 9