[Python] Problem Solving을 위한 기본기 모음
·
Algorithm
Python Basic Techniques for Problem Solving 오랜만에 PS를 재개함에 따라 기억에서 사라진 테크닉들을 되살리기 위한 글입니다. 파이썬은 C++(혹은 C)와 입출력 방법, 리스트 활용 방법 등에서 차이가 있으므로 필요할 때마다 찾아보시면 좋습니다! 파이썬으로 입력 어떻게 받냐고 물어보면 이 글 링크 넘길거야.. 혹시 또 다른 좋은 팁 있으면 알려주세요 :) 1. 입력 Input function: stdin.readline() # 입력을 빠르게 받을 때 from sys import stdin input() 대신 stdin.readline()으로 입력받는 것이 PS에서 유리하다. 이유는 다음과 같다. 1. stdin.readline()은 prompt(입력하라고 깜빡이는 그것)..
[LeetCode] 901. Online Stock Span
·
Algorithm
LeetCode 901. Online Stock Span 🗓️ Daily LeetCoding Challenge November, Day 9 Stack Binary Search https://leetcode.com/problems/online-stock-span/ Online Stock Span - 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 1. 문제 설명 특정 주식에 대한 일일 가격을 수집하고, 주가폭을 계산하는 문제이다. 오늘 주가폭은 오늘 주가보다 작거나..
[LeetCode] 1544. Make The String Great (Python)
·
Algorithm
LeetCode 1544. Make The String Great 🗓️ Daily LeetCoding Challenge November, Day 8 Stack https://leetcode.com/problems/make-the-string-great/ Make The String Great - 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 1. 문제 설명 문자열 s가 주어지고, 두 문자가 Good(?)인 경우 리턴하는 문제이다. Good을 만족하는 조건은 다음..
[LeetCode] 345. Reverse Vowels of a String (Python)
·
Algorithm
LeetCode 345. Reverse Vowels of a String 🗓️ Daily LeetCoding Challenge November, Day 4 String / Two Pointers https://leetcode.com/problems/reverse-vowels-of-a-string/ Reverse Vowels of a 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 1. 문제 설명 문자열 s가 주어지고, s의 모음만 순서를 뒤집은 후..
[LeetCode] 2131. Longest Palindrome by Concatenating Two Letter Words (Python)
·
Algorithm
LeetCode 1706. Longest Palindrome by Concatenating Two Letter Words 🗓️ Daily LeetCoding Challenge November, Day 3 String https://leetcode.com/problems/longest-palindrome-by-concatenating-two-letter-words/ Longest Palindrome by Concatenating Two Letter Words - 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 nex..