Algorithm220 [코딩 + 알고리즘 온라인 완주반] 1일차. 파이썬 설치, 가상환경 설정 # 개발 환경 - 사용 언어 및 버전 : 파이썬 3.7.6 - 통합 개발 환경 : Visual Studio Code ( 터미널에서 'code' 입력) # 파이썬 언어 장점 - 문법이 간결 - 다양한 운영체제 지원 - GUI Application 개발 (PyQT) - 방대한 라이브러리 지원 (프레임워크, 오픈소스,...) - 범용언어 (네트워크, 웹, 데이터분석, 기계학습 등) # 가상환경 설정하기 MacBookPro ~ % cd /Users/사용자이름/Documents/FastCampus MacBookPro FastCampus % python -m venv python_basic # 새로운 폴더 생성 MacBookPro FastCampus % cd python_basic MacBookPro python_.. 2021. 3. 15. [LEET CODE] 49. Group Anagrams (dict 자료형, sort(), sorted()) # Problem * anagram(애너그램) : 일종의 언어유희로 문자를 재배열하여 다른 뜻을 가진 단어로 바꾸는 것 Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example 1: Input : strs = ["eat","tea","tan","ate","nat","bat"] Output : [["bat.. 2021. 3. 15. [LEET CODE] 819. Most Common Word ( 정규표현식 ) #Problem Given a string paragraph and a string array of the banned words banned, return the most frequent word that is not banned. It is guaranteed there is at least one word that is not banned, and that the answer is unique. The words in paragraph are case-insensitive and the answer should be returned in lowercase. Example 1: Input : paragraph : "Bob hit a ball, the hit BALL flew far after it w.. 2021. 3. 15. [LEET CODE] 937. Reorder Data in Log Files ( lambda 함수, 문자열 확인 함수 ) # Problem You are given an array of logs. Each log is a space-delimited string of words, where the first word is the identifier. There are two types of logs: Letter-logs: All words (except the identifier) consist of lowercase English letters. Digit-logs: All words (except the identifier) consist of digits. Reorder these logs so that: The letter-logs come before all digit-logs. The letter-logs ar.. 2021. 3. 14. [LEET CODE] 344. Reverse String #Problem Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. You may assume all the characters consist of printable ascii characters. Example 1: Input: ["h","e","l","l","o"] Output: ["o","l","l","e","h"] # My Answer class S.. 2021. 3. 4. [LEET CODE]127. Valid Palindrome # Problem Given a string s, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Example 1: Input: s = "A man, a plan, a canal: Panama" Output: true Explanation: "amanaplanacanalpanama" is a palindrome. Example 2: Input: s = "race a car" Output: false Explanation: "raceacar" is not a palindrome. Constraints: 1 bool: strs = [] for char in s: if char.isalnu.. 2021. 3. 3. 이전 1 ··· 31 32 33 34 35 36 37 다음 반응형