Skip to content

Commit

Permalink
261st Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed Jan 7, 2025
1 parent cf381d1 commit 1bd573a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/page-1/72. Edit Distance/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 72. 編輯距離 (Edit Distance)

給定兩個字串 word1 和 word2,返回將 word1 轉換為 word2 所使用的最少操作數。
給定兩個字串 `word1``word2`,返回將 `word1` 轉換為 `word2` 所使用的最少操作數。

你可以對字詞進行以下三種操作:

Expand Down
34 changes: 34 additions & 0 deletions src/page-11/1071. Greatest Common Divisor of Strings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 1071. 字串的最大公因數 (Greatest Common Divisor of Strings)

對於兩個字串 `s``t`,只有在 `s = t + t + t + ... + t + t` (即 `t` 與自身連接一次或多次) 時,我們才認定「`t` 可以整除 `s`」。

給定兩個字串 `str1``str2`,返回最長的字串 `x`,使得 `x` 可以同時整除 `str1``str2`

範例 1:

```coffee
輸入: str1 = "ABCABC", str2 = "ABC"
輸出: "ABC"
```

範例 2:

```coffee
輸入: str1 = "ABABAB", str2 = "ABAB"
輸出: "AB"
```

範例 3:

```coffee
輸入: str1 = "LEET", str2 = "CODE"
輸出: ""
```

## 解題

```ts
export const gcdOfStrings: GcdOfStrings = (str1, str2) => {
//
};
```

0 comments on commit 1bd573a

Please sign in to comment.