S "osteoclasts undergo apoptosis at the end of the bone resorption phase"
D!; S{&D.?+1} //count frequencies
H heap; D{|H.push@?{}} //add frequencies to heap
(H.n-1){I=|A H.pop; B H.pop; H.push A.0+B.0 A.1,B.1} //build tree
C [[]H.pop.1](:D,[L R] = @[0,@D L]^r @[1,@D R]^r; D,C=:C,D) //unroll tree
say C.s(?1.n<??1.n) //output sorted by code length