Talk:Find the missing permutation: Difference between revisions

(→‎Simple solution: new section)
 
Line 211:
*Position 4: A:6, B:6, '''C:5''', D:6
Therefore the missing permutation is DBAC. --[[User:Ce|Ce]] 19:49, 16 August 2010 (UTC)
 
This approach is not very general, but you are right that the task does not need a general solution. For what it's worth here is this approach in J:
 
<lang j> ,(~. #~ 5 = #/.~)"1 |:data
DBAC</lang>
 
This was only about 30% faster but it's also a lot shorter -- mostly because I did not bother using any names for the functional part.
 
--[[User:Rdm|Rdm]] 19:24, 17 August 2010 (UTC)
6,951

edits