| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Tags
- LEVEL 2
- Kubernetes
- swift
- 3D PRINTING
- 코딩테스트
- MySQL
- ProblemSoving
- C++
- leetcode
- 프로그래머스
- 문제해결
- 알고리즘
- ProblemSolving
- Count Monobit Integers
- 하늘과 바람과 별과 詩
- Qualification Round
- 파이썬
- Python
- hackerrank
- 2022
- 해커랭크
- GitLab
- First Unique Character in a String
- K8S
- Algorithm
- Code Jam
- 하늘과 바람과 별과 시
- 리트코드
- Code Jam 2022
Archives
- Today
- Total
목록Longest Common Prefix (1)
공대생의 비망록
[LeetCode][Easy] Longest Common Prefix 문제 Python 풀이
주어진 문자열 배열 strs에 대하여, 가장 긴 공통문자열을 찾는 문제.예를 들어 "flower", "flow", "flight" 문자열들이 주어졌다면 "fl"을 찾아 반환해야 한다. 문제 풀이:class Solution: def longestCommonPrefix(self, strs: List[str]) -> str: length = 201 # Since the max length for this problem is 200. # length = min(len(w) for w in strs) # Pythonic way for s in strs: # set var length as the shortest string's length. if le..
Programming Language/Python
2026. 2. 9. 18:06