摘要: 假设有且仅有 1 个最大公共子串。比如,输入 a = "13452439", b = "123456"。由于字符串 "345" 同时在 a 和 b 中出现,且是同时出现在 a 和 b 中的最长子串。因此输出 "345"。 func main() { a := "123456" b := "13452 阅读全文
posted @ 2020-08-31 17:09 顽强的allin 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 给定一个字符串,逐个翻转字符串中的每个单词。例如,输入: "the sky is blue",输出: "blue is sky the"。 package main import ( "fmt" "strings" ) type SStack struct { elems []string } fu 阅读全文
posted @ 2020-08-31 17:05 顽强的allin 阅读(340) 评论(0) 推荐(0) 编辑