[leetcode-1] Two Sum
ยท
๐Ÿข One step
LeetCode-1 Two Sum : target๊ณผ ์ผ์น˜ํ•˜๋Š” ๋ฆฌ์ŠคํŠธ ๋‘๊ฐœ์˜ ํ•ฉ note : OMyAnswer (O(n * n))class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: len_nums = len(nums) if len_nums==2: return [0,1] for i in range(len(nums)): for j in range(i+1,len(nums)): if target==(nums[i]+nums[j]): return [i, j] Result : 3649ms Memory: 14.9mbAnswer O(n * n) (in์˜ ์‹œ๊ฐ„ ๋ณต์žก๋„ n)class Solution: def twoSum(self, nums:..
[leetcode-5] Longest Palindrome Substring
ยท
๐Ÿข One step
LeetCode-5 Longest Palindrome Substring : ๊ฐ€์žฅ ๊ธด Palindrome note :Myanswerclass Solution: def longestPalindrome(self, s: str) -> str: if len(s)==1: return s[0] for i in range(0,len(s)-1): for j in range(0,i+1): org = s[j:len(s)-(-j+i)] if org[::-1]==org: return org return org[0] Result : 6515ms Memory: 13.9mbSolutionclass Solution: def longestPalindrome(self, s: str) -> str: def expend(left: int, ..
[์ •๋ ฌ ์•Œ๊ณ ๋ฆฌ์ฆ˜] ํŒ€์†ŒํŠธ(Tim sort)
ยท
๐Ÿ Python
https://en.wikipedia.org/wiki/Timsort Timsort - Wikipedia From Wikipedia, the free encyclopedia Hybrid sorting algorithm based on insertion sort and merge sort Timsort is a hybrid, stable sorting algorithm, derived from merge sort and insertion sort, designed to perform well on many kinds of real-world data. It w en.wikipedia.org Timsort Peter McIlroy์˜ 1993๋…„ ๋…ผ๋ฌธ์ธ [Optimistic Sorting and Informati..
[leetcode-49] Group Anagrams
ยท
๐Ÿข One step
LeetCode-49 Group Anagrams : ์–ธ์–ด์œ ํฌ ex) cat -> act cat note : hint: collections.defaultdict(list)class Solution: def groupAnagrams(self, strs: List[str]) -> List[List[str]]: anagrams = defaultdict(list) for word in strs: anagrams[''.join(sorted(word))].append(word) return list(anagrams.values()) Result : 98ms Memory: 17.2mbdefault_factory: index[x] ์—์„œ x๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์„ ๋•Œ ValueError๋•Œ ๋ฐœ์ƒํ•œ๋‹ค. ๋ชจ๋“  ๊ตฌํ˜„์ด ..
[ChatGPT] ChatGPT + Iphone User Mode ๊ณต์œ 
ยท
๐Ÿ› ๏ธ Tools/๐Ÿค– ChatGPT
https://github.com/seohyunjun/ChatGPT-IOS-ShortCut/blob/main/README.md GitHub - seohyunjun/ChatGPT-IOS-ShortCut: This is Ios Shortcutfile. using ChatGPT API (require your own OpenAI API-KEY) This is Ios Shortcutfile. using ChatGPT API (require your own OpenAI API-KEY) - GitHub - seohyunjun/ChatGPT-IOS-ShortCut: This is Ios Shortcutfile. using ChatGPT API (require your own OpenAI API-KEY) github...
[ChatGPT API] ์•„์ดํฐ+ChatGPT ์œตํ•ฉ! (GPT3.5 turbo) ์œ ๋ฃŒ
ยท
๐Ÿ› ๏ธ Tools/๐Ÿค– ChatGPT
ChatGPT API์™€ iphone ๋‹จ์ถ•์–ด๋ฅผ ํ™œ์šฉํ•ด Siri๋ฅผ ๋Œ€์ฒดํ•˜์ž ~ https://matemarschalko.medium.com/chatgpt-in-an-ios-shortcut-worlds-smartest-homekit-voice-assistant-9a33b780007a ChatGPT in an iOS Shortcut — Worlds Smartest HomeKit Voice Assistant Ever since I tried ChatGPT and GPT-3, everything else feels painfully dumb and useless: Siri, Alexa, Google Home and all other “smart”… matemarschalko.medium.com ๊ธฐ์กด์˜ GPT API..
๋‹คํ–ˆ๋‹ค
B's