tag:blogger.com,1999:blog-17087850.post244224854186307530..comments2023-10-31T06:50:41.697-04:00Comments on Factor: a practical stack language: Cedric's code challengeSlava Pestovhttp://www.blogger.com/profile/02768382790667979877noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-17087850.post-5496811791635259222008-06-29T17:18:00.000-04:002008-06-29T17:18:00.000-04:00Crest: here's another approach which avoids both i...Crest: here's another approach which avoids both intermediate sequences:<BR/><BR/>1 10000 [a,b] [ number>string all-unique? ] filter<BR/>[ ] [ length ] [ 2 <clumps> 0 [ first2 swap - max ] reduce ] triSlava Pestovhttps://www.blogger.com/profile/02768382790667979877noreply@blogger.comtag:blogger.com,1999:blog-17087850.post-76932613846415478442008-06-29T05:49:00.000-04:002008-06-29T05:49:00.000-04:00Although having more tokens I prefer this version ...Although having more tokens I prefer this version because it doesn't create an uneccesary copy of the the 5274 element sequence returned by filter by appending the prefix 0.<BR/><BR/>1 10000 [a,b] [ number>string all-unique? ] filter<BR/>[ ] [ length ] [ [ 1 tail-slice ] keep v- supremum ] triAnonymousnoreply@blogger.com