RosettaCodeData/Task/Find-common-directory-path/J/find-common-directory-path-1.j

5 lines
126 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
parseDirs =: = <;.2 ]
getCommonPrefix =: {. ;@{.~ 0 i.~ *./@(="1 {.)
getCommonDirPath=: [: getCommonPrefix parseDirs&>