å¤ç¬ã®Haskellã«è¡ã£ã¦ããï¼ã®ã§ï¼ææ³ã¨ãã®ãã©ãã¼ã¢ããã«ãªããããªãã¨ãæ¸ãï¼ ã¨ã¦ãããä¼ã ã£ãããã«æãï¼ é å»ãã¦ç¾å ´ã«ä»ãããRLEãã¦ã¿ããã¨ããä¾é¡("AABBCCC"ã"A2B2C3"ã«ããé¢æ°ãæ¸ãã)ããã£ã¦ãã¦ï¼ id:khibino0 ãããããããã« import Data.List ( group ) import Control.Arrow rle = concatMap (uncurry (:) . (head &&& show . length)) . group ã®ãããªè§£ãããããã¦ãããããªã©ï¼ã§ï¼åèªèªåå®è£ ãã¦ã人ãã¡ã®ã³ã¼ãã¨ãè¦ãã¨ãç´°ããæä½ã§ããã ã¢ããã«ãããããã¨ãå®ç¾ãããã¨ãã¦ããªã¼ãã¨æãããã¨ãå¤ãã£ãï¼Haskellã®å ´å(ãªã®ãã¯ç¥ããªãã)ãã£ã¨å¤§åçãªå¤æããããããã¦ã³ã«èãã¦ãã£ãã»ããã·ã³ãã«ã§ã½ã¬ã£ã½ã
{{#tags}}- {{label}}
{{/tags}}