-2 bytes and(and increased the performance by not generating the entire list) thanks to @Grimy.
Au # Push the lowercase alphabet, and uppercase it
2ã # Create all possible pairs by taking the cartesian product with itself:
# ["AA","AB","AC",...,"ZY","ZZ"]
ã # Get the cartesian product of this list with itself:
# [["AA","AA"],["AA","AB"],...,["ZZ","ZZ"]]
s # Swap to push the (implicit) input
₄‰ # Take the divmod-1000 of it
# i.e. 7483045 becomes [7483,45]
` # Push these values looseseparated to the stack
U # Pop and store the remainder part in variable `X`
è # Index the integer part into the list of letter-pairs we created earlier
# i.e. 7483 will result in ["AL","BV"]
X # Push the remainder part from variable `X` again
₄+ # Add 1000 to the integerit
¦ # And remove the leading 1 (so now the number is padded with leading 0s)
# i.e. 45 becomes 1045 and then "045"
'-.ø '# Surround each numberthis with "-" (i.e. "045" becomes "-045-")
ý # Join the two pairs of letters by this
# i.e. ["AL","BV"] and "-045-" becomes "AL-045-BV"
# (after which the top of the stack is output implicitly as result)
The last part (s₄‰`UèX₄+¦'-.øý
) could be I₄÷èI₄+3.£.ý'-ý
for an equal-bytes alternative:
Try it online or verify all test cases.
I₄÷ # Push the input, integer-divided by 1000
è # Use it to index into the letter-pairs we created earlier
# i.e. 7483045 becomes 7483 and then ["AL","BV"]
I₄+ # Push the input again, and add 1000
3.£ # Only leave the last three digits
# i.e. 7483045 becomes 7484045 and then "045"
.ý # Intersperse the pair with this
# i.e. ["AL","BV"] and "045" becomes ["AL","045","BV"]
'-ý '# And join this list by "-"
# i.e. ["AL","045","BV"] becomes "AL-045-BV"
# (after which the top of the stack is output implicitly as result)