Go, Vantage point
가까운 곳을 걷지 않고 서는 먼 곳을 갈 수 없다.
Github | https://github.com/overnew/
Blog | https://everenew.tistory.com/
문제 https://leetcode.com/problems/longest-unequal-adjacent-groups-subsequence-ii/ Longest Unequal Adjacent Groups Subsequence II - LeetCode Can you solve this real interview question? Longest Unequal Adjacent Groups Subsequence II - You are given an integer n, a 0-indexed string array words, and a 0-indexed array groups, both arrays having length n. The hamming distance between two strings of lee..
문제 https://leetcode.com/problems/count-of-sub-multisets-with-bounded-sum/description/ Count of Sub-Multisets With Bounded Sum - LeetCode Can you solve this real interview question? Count of Sub-Multisets With Bounded Sum - You are given a 0-indexed array nums of non-negative integers, and two integers l and r. Return the count of sub-multisets within nums where the sum of elements in each s leet..
문제 https://leetcode.com/problems/maximum-number-of-k-divisible-components/description/ Maximum Number of K-Divisible Components - LeetCode Can you solve this real interview question? Maximum Number of K-Divisible Components - There is an undirected tree with n nodes labeled from 0 to n - 1. You are given the integer n and a 2D integer array edges of length n - 1, where edges[i] = [ai, bi] ind le..
문제 https://leetcode.com/problems/split-array-into-maximum-number-of-subarrays/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 풀이 난이도: Medium SubArr는 연속이어야 했기때문에 쉬운 문제였다. A subarray is a contiguous part of an ar..
문제 https://leetcode.com/problems/minimum-array-length-after-pair-removals/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 풀이 난이도: Medium 어떤 식으로 쌍을 맞춰줘야 될지 이리저리 해봤지만, 결국에는 간단한 그리디 방식으로 해결된다. 아래 배열에서 쌍을 맞춰보자. 1 1..
문제 https://leetcode.com/problems/maximum-element-sum-of-a-complete-subset-of-indices/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 풀이 난이도: Hard weekly contest의 최종 보스 문제. https://leetcode.com/contest/weekly-co..
문제 https://leetcode.com/problems/maximum-number-of-alloys/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 풀이 난이도: Medium 주간 Leetcode contest문제를 풀어보자~~ https://leetcode.com/discuss/general-discussion/4053842/wee..
문제 https://www.acmicpc.net/problem/25760 25760번: 귀경길 교통상황을 알려드립니다 정현이가 살고 있는 나라에는 각 지역을 연결하는 도로망이 있다. 도로망은 총 $N$개의 지점과 두 지점을 연결하는 $N-1$개의 양방향 도로로 구성되어 있으며, 모든 두 지점 사이를 도로망으로 이 www.acmicpc.net 풀이 solved.ac 난이도: Gold 2 생각해본 풀이의 예외 케이스를 도저히 찾지 못해서 다른 분의 풀이를 참고해서 해결하였다. 틀린 풀이 일단 내가 생각해 본 풀이는 그리디 방식이다. N개의 노드에 N-1개의 간선이 있다면, 루프가 생길 수 없기 때문에 트리 형태가 된다. 1번 노드가 탈출구 이기 때문에 1번 노드를 루트로 선택하면 트리가 형성된다. 간선은 양..
문제 https://www.acmicpc.net/problem/1208 1208번: 부분수열의 합 2 첫째 줄에 정수의 개수를 나타내는 N과 정수 S가 주어진다. (1 ≤ N ≤ 40, |S| ≤ 1,000,000) 둘째 줄에 N개의 정수가 빈 칸을 사이에 두고 주어진다. 주어지는 정수의 절댓값은 100,000을 넘지 않는다. www.acmicpc.net 풀이 solved.ac 난이도: Gold 1 원소가 부분수열에 포함되는지 여부를 경우의 수로 생각해 보자. 포함되느냐 안되느냐인 두 가지 선택을 40개의 수에 적용하면 2^40 가지의 경우가 나온다. 2^40 = 1,099,511,627,776(약 1TB) 이므로 시간 안에 동작시킬 수 없다. 여기서 사용되는 기법이 양방향 탐색(Bidirectional..
문제 https://leetcode.com/problems/find-median-from-data-stream/description/ Find Median from Data Stream - LeetCode Can you solve this real interview question? Find Median from Data Stream - The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two middle values. * For exam leetcode.com 풀이 난이도: Hard ..