RosettaCodeData/Task/Longest-string-challenge/J/longest-string-challenge.j
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

7 lines
219 B
Text

isempty =. (0 [ 0&{) :: 1: NB. 0=#
compare =. ($:&}.)`((0 1,:_1 0) {~ <@,&isempty)@.(+.&isempty) NB. *@-&#
add =. ,`(,:@[)`] @. (compare {:)
> add&.>/ (}: , ,:&.>@{:) ;: 'a bb ccc ddd ee f ggg'
ccc
ddd
ggg