본문 바로가기

분류 전체보기228

[백준/파이썬] 괄호 - 스택 [백준/파이썬] 괄호 - 스택 난이도: 실버4 시간 제한 메모리 제한 제출 정답 맞힌 사람 정답 비율 1 초 128 MB 189411 88844 63904 45.837% 문제 괄호 문자열(Parenthesis String, PS)은 두 개의 괄호 기호인 ‘(’ 와 ‘)’ 만으로 구성되어 있는 문자열이다. 그 중에서 괄호의 모양이 바르게 구성된 문자열을 올바른 괄호 문자열(Valid PS, VPS)이라고 부른다. 한 쌍의 괄호 기호로 된 “( )” 문자열은 기본 VPS 이라고 부른다. 만일 x 가 VPS 라면 이것을 하나의 괄호에 넣은 새로운 문자열 “(x)”도 VPS 가 된다. 그리고 두 VPS x 와 y를 접합(concatenation)시킨 새로운 문자열 xy도 VPS 가 된다. 예를 들어 “(())(.. 2023. 12. 13.
[리트코드/파이썬] 739. Daily Temperatures (스택) [리트코드/파이썬] 739. Daily Temperatures (스택) 난이도: Medium 739. Daily Temperatures Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead. Example 1: Input: temperatures = [7.. 2023. 12. 13.
[리트코드/파이썬] 561. Array Partition(그리디) [리트코드/파이썬] 561. Array Partition(그리디) 561. Array Partition 난이도: Easy Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized. Return the maximized sum. Example 1: Input: nums = [1,4,3,2] Output: 4 Explanation: All possible pairings (ignoring the ordering of elements) are: 1. (1, 4), (2,.. 2023. 12. 11.
[리트코드/파이썬] 15. 3Sum(투 포인터) [리트코드/파이썬] 15. 3Sum(투 포인터) 난이도: Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain duplicate triplets. Example 1: Input: nums = [-1,0,1,2,-1,-4] Output: [[-1,-1,2],[-1,0,1]] Explanation: nums[0] + nums[1] + nums[2] = (-1) + 0 + 1 = 0. nums[1] + n.. 2023. 12. 11.
[리트코드/파이썬] 5. Longest Palindromic Substring [리트코드/파이썬] 5. Longest Palindromic Substring 5. Longest Palindromic Substring Medium Given a string s, return the longest palindromic substring in s 참고 palindromic 문자열: 왼쪽에서 오른쪽으로 읽으나 오른쪽에서 왼쪽으로 읽으나 같은 문자열을 말한다. Example 1: Input: s = "babad" Output: "bab" Explanation: "aba" is also a valid answer. Example 2: Input: s = "cbbd" Output: "bb" Constraints: 1 =0 and e=0 and e+1 e-s: s = i - (length-1)/.. 2023. 12. 11.
[리트코드/파이썬] 49. Group Anagrams (문자열, 딕셔너리) [리트코드/파이썬] 49. Group Anagrams (문자열, 딕셔너리) 49. Group Anagrams Medium 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".. 2023. 12. 11.
[백준/파이썬] 10809 - 알파벳 찾기 (구현, 문자열) [백준 브론즈2] 10809 - 알파벳 찾기 시간 제한메모리 제한제출정답맞힌 사람정답 비율 1 초 256 MB 204889 109364 90072 53.139% 문제 알파벳 소문자로만 이루어진 단어 S가 주어진다. 각각의 알파벳에 대해서, 단어에 포함되어 있는 경우에는 처음 등장하는 위치를, 포함되어 있지 않은 경우에는 -1을 출력하는 프로그램을 작성하시오. 입력 첫째 줄에 단어 S가 주어진다. 단어의 길이는 100을 넘지 않으며, 알파벳 소문자로만 이루어져 있다. 출력 각각의 알파벳에 대해서, a가 처음 등장하는 위치, b가 처음 등장하는 위치, ... z가 처음 등장하는 위치를 공백으로 구분해서 출력한다. 만약, 어떤 알파벳이 단어에 포함되어 있지 않다면 -1을 출력한다. 단어의 첫 번째 글자는 0번.. 2023. 12. 11.
와이어 프레임 https://www.figma.com/ Figma: The Collaborative Interface Design Tool Figma is the leading collaborative design tool for building meaningful products. Seamlessly design, prototype, develop, and collect feedback in a single platform. www.figma.com 팀원들과 같이 실시간으로 소통하면서 UI를 구성할 수 있다. https://miro.com/ko/wireframe/ 모든 디자인을 위한 온라인 와이어프레임 작성 도구 | Miro Miro의 무료 와이어프레임 도구를 사용하여 손쉽게 웹사이트와 와이어프레임을 만들어 보세요... 2023. 12. 9.
알고리즘 https://programmers.co.kr/ 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr - PCCP 자격증 시험 (응시료 4만원) https://www.acmicpc.net/ Baekjoon Online Judge Baekjoon Online Judge 프로그래밍 문제를 풀고 온라인으로 채점받을 수 있는 곳입니다. www.acmicpc.net https://softeer.ai/index Softeer - 현대자동차그룹 SW인재확보플랫폼 Softeer is for software Engineer. softeer.ai - 여기도 자격증 시험이 있고, .. 2023. 12. 9.
[SQL Alchemy] 데이터베이스 칼럼을 삭제했는데 계속 없는 칼럼을 참조하는 오류 오류 OperationalError sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: user.user_nickname [SQL: SELECT user.id AS user_id_1, user.user_id AS user_user_id, user.user_password AS user_user_password, user.user_nickname AS user_user_nickname FROM user WHERE user.user_id = ? AND user.user_password = ? LIMIT ? OFFSET ?] [parameters: ('하영', 'abc', 1, 0)] (Background on this err.. 2023. 12. 6.
[프로그래머스 Lv4/파이썬] 사칙연산(DP) [프로그래머스 Lv4/파이썬] 사칙연산(DP) 문제 설명 사칙연산에서 더하기(+)는 결합법칙이 성립하지만, 빼기(-)는 결합법칙이 성립하지 않습니다. 예를 들어 식 1 - 5 - 3은 연산 순서에 따라 다음과 같이 다른 결과를 가집니다. ((1 - 5) - 3) = -7 (1 - (5 - 3)) = -1 위 예시와 같이 뺄셈은 연산 순서에 따라 그 결과가 바뀔 수 있습니다. 또 다른 예로 식 1 - 3 + 5 - 8은 연산 순서에 따라 다음과 같이 5가지 결과가 나옵니다. (((1 - 3) + 5) - 8) = -5 ((1 - (3 + 5)) - 8) = -15 (1 - ((3 + 5) - 8)) = 1 (1 - (3 + (5 - 8))) = 1 ((1 - 3) + (5 - 8)) = -5 위와 같이 서.. 2023. 12. 4.
[프로그래머스 Lv3/파이썬] N으로 표현(DP), (테케 2번, 9번) [프로그래머스 Lv3/파이썬] N으로 표현 문제 설명 아래와 같이 5와 사칙연산만으로 12를 표현할 수 있습니다. 12 = 5 + 5 + (5 / 5) + (5 / 5) 12 = 55 / 5 + 5 / 5 12 = (55 + 5) / 5 5를 사용한 횟수는 각각 6,5,4 입니다. 그리고 이중 가장 작은 경우는 4입니다. 이처럼 숫자 N과 number가 주어질 때, N과 사칙연산만 사용해서 표현 할 수 있는 방법 중 N 사용횟수의 최솟값을 return 하도록 solution 함수를 작성하세요. 제한사항 N은 1 이상 9 이하입니다. number는 1 이상 32,000 이하입니다. 수식에는 괄호와 사칙연산만 가능하며 나누기 연산에서 나머지는 무시합니다. 최솟값이 8보다 크면 -1을 return 합니다. 입.. 2023. 12. 1.