作者yam276 (史萊哲林的優等生)
看板Marginalman
標題Re: [閒聊] 每日leetcode
時間Mon Apr 1 10:50:56 2024
※ 引述《SecondRun (南爹摳打)》之銘言:
: 58.Length of Last Word
: 找出字串s裡最後面一個字的長度
: 想法:沒有
Code:
(define (length-of-last-word s)
(let* ((trimmed (string-trim s))
(words (string-split trimmed))
(last-word (last words)))
(string-length last-word)))
愚人節用奇怪的語言解題
Racket這到底什麼語言
解出來 182ms 101.27MB ==
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.193.249.242 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1711939858.A.9E3.html
※ 編輯: yam276 (123.193.249.242 臺灣), 04/01/2024 10:52:45
推 sustainer123: 這啥奇怪語言 04/01 10:54
Racket是 Scheme 的一种方言,而Scheme又是 Lisp 的一种方言。
→ yam276: 窩不知道 窩不清楚 好像是Lisp家族的 04/01 10:55
→ yam276: function用法我都問gpt的 04/01 10:55
※ 編輯: yam276 (123.193.249.242 臺灣), 04/01/2024 10:57:42
推 SecondRun: 好酷 04/01 11:41