개발공부/algorithm

개발공부/algorithm

[Leetcode][python] 1528. Shuffle String

Problem Leetcode 1528. Shuffle String Level: Easy Link Shuffle String - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com My Code class Solution(object): def restoreString(self, s, indices): listShuffle = list(s) for x in range(len(s)): listShuffle[indices[x]] = s[x] return ''.join(l..

개발공부/algorithm

[Leetcode][python] 14. Longest Common Prefix

Problem Leetcode 14. Longest Common Prefix Level: Easy Link Longest Common Prefix - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com My Code class Solution: def longestCommonPrefix(self, strs: List[str]) -> str: strs, temp = sorted(strs),"" for i in range(len(strs[0])): if strs[0][i..

개발공부/algorithm

[Leetcode][python] 374. Guess Number Higher or Lower - Binary Search

Problem Leetcode 374. Guess Number Higher or Lower - Binary Search Level: Easy Link Guess Number Higher or Lower - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com My Code 기본적인 Binary Search 문제이다. n = 2, pick = 2, n=1, pick 1 처럼 interval이 얼마 차이 나지 않는 경우들에 대한 조건처리가 잘 되어야 한다. # The gu..

so.py
'개발공부/algorithm' 카테고리의 글 목록 (2 Page)