A = 0
B = 1
C = 10
D = 11

Given a binary number, substitute letters for strings of digits, e.g. 1001 = CAB.

Can you write an algorithm to find the ShortLex minimal letter representation of any number? ShortLex: compare by length, and then alphabetically, e.g. CA<BAA, BC<DA.

1 favourite 0 retweets

View this tweet on twitter.com

This tweet as JSON