R, 73 bytes
`-`=\(n,s="",`<`=paste0)`if`(n,n%/%16-c(0:9,LETTERS[1:6])[1+n%%16]<s,0<s)
Attempt This Online!
Similar to the JS and Python answers, but uses recursion.
Adds a leading 0 ...
posted 21d ago
by Glory2Ukraine
· edited
19d ago
by Glory2Ukraine
Answer