From ac6c18c1afbd461a3590580a79fa1bcb1329a687 Mon Sep 17 00:00:00 2001 From: Jinyoung Jeong <80400463+jyoung2419@users.noreply.github.com> Date: Thu, 8 Oct 2026 22:40:17 +0900 Subject: [PATCH 1/2] Create 26. Remove Duplicates from Sorted Array --- .../26. Remove Duplicates from Sorted Array" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "leetcode3/\354\240\225\354\247\204\354\230\201/26. Remove Duplicates from Sorted Array" diff --git "a/leetcode3/\354\240\225\354\247\204\354\230\201/26. Remove Duplicates from Sorted Array" "b/leetcode3/\354\240\225\354\247\204\354\230\201/26. Remove Duplicates from Sorted Array" new file mode 100644 index 00000000..5a2c4a86 --- /dev/null +++ "b/leetcode3/\354\240\225\354\247\204\354\230\201/26. Remove Duplicates from Sorted Array" @@ -0,0 +1,16 @@ +/** + * @param {number[]} nums + * @return {number} + */ +var removeDuplicates = function(nums) { + let k = 1; + + for (let i = 1; i Date: Thu, 8 Oct 2026 22:40:39 +0900 Subject: [PATCH 2/2] Add function to find longest uncommon subsequence --- .../522. Longest Uncommon Subsequence II" | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 "leetcode3/\354\240\225\354\247\204\354\230\201/522. Longest Uncommon Subsequence II" diff --git "a/leetcode3/\354\240\225\354\247\204\354\230\201/522. Longest Uncommon Subsequence II" "b/leetcode3/\354\240\225\354\247\204\354\230\201/522. Longest Uncommon Subsequence II" new file mode 100644 index 00000000..93ee55e8 --- /dev/null +++ "b/leetcode3/\354\240\225\354\247\204\354\230\201/522. Longest Uncommon Subsequence II" @@ -0,0 +1,39 @@ +/** + * @param {string[]} strs + * @return {number} + */ +var findLUSlength = function(strs) { + let ans = -1; + + function isSubsequence(a, b) { + let i = 0; + + for (let j = 0; j < b.length; j++) { + if (a[i] === b[j]) { + i++; + } + } + + return i === a.length; + } + + for (let i = 0; i < strs.length; i++) { + let uncommon = true; + + for (let j = 0; j < strs.length; j++) { + if (i === j) continue; + + // strs[i]가 다른 문자열의 부분수열이면 탈락 + if (isSubsequence(strs[i], strs[j])) { + uncommon = false; + break; + } + } + + if (uncommon) { + ans = Math.max(ans, strs[i].length); + } + } + + return ans; +};