목록PS/LeetCode (586)
넘치게 채우기
https://leetcode.com/problems/compare-version-numbers/description/leetcode - Compare Version Numbers문제 유형 : 문자열 처리, 투 포인터, 슬라이딩 윈도우문제 난이도 : Medium 문제Given two version numbers, version1 and version2, compare them.Version numbers consist of one or more revisions joined by a dot '.'. Each revision consists of digits and may contain leading zeros. Every revision contains at least one character. Revi..
https://leetcode.com/problems/largest-positive-integer-that-exists-with-its-negative/description/leetcode - Largest Positive Integer That Exists With Its Negative문제 유형 : 정렬, 구현, 그리디, 투포인터문제 난이도 : Easy 문제Given an integer array nums that does not contain any zeros, find the largest positive integer k such that -k also exists in the array.Return the positive integer k. If there is no such integer, ..
https://leetcode.com/problems/reverse-prefix-of-word/description/leetcode - Reverse Prefix of Word문제 유형 : 문자열 처리, 스택, 큐문제 난이도 : Easy 문제Given a 0-indexed string word and a character ch, reverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive). If the character ch does not exist in word, do nothing.For example, if word = "abcdefd" and ch = ..
https://leetcode.com/problems/number-of-wonderful-substrings/description/leetcode - Number of Wonderful Substrings문제 유형 : 비트마스킹, 비트 조작문제 난이도 : Medium 문제A wonderful string is a string where at most one letter appears an odd number of times.For example, "ccjjc" and "abab" are wonderful, but "ab" is not.Given a string word that consists of the first ten lowercase English letters ('a' through 'j'),..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/H8kRv/btsG13nu5rV/Ma2FuclIJR5g9GGTkWEIC0/img.png)
https://leetcode.com/problems/minimum-number-of-operations-to-make-array-xor-equal-to-k/description/leetcode - Minimum Number of Operations to Make Array XOR Equal to K문제 유형 : 비트마스킹, 비트 조작문제 난이도 : Medium 문제You are given a 0-indexed integer array nums and a positive integer k.You can apply the following operation on the array any number of times:Choose any element of the array and flip a bit in i..
https://leetcode.com/problems/sum-of-distances-in-tree/description/leetcode - Sum of Distances in Tree문제 유형 : dfs, 재귀, 트리, 다이나믹 프로그래밍문제 난이도 : Hard 문제There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges.You are given the integer n and the array edges where edges[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the tree.Return an array ..
https://leetcode.com/problems/freedom-trail/description/leetcode - Freedom Trail문제 유형 : 재귀 / dfs / 다이나믹 프로그래밍문제 난이도 : Hard 문제In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring" and use the dial to spell a specific keyword to open the door.Given a string ring that represents the code engraved on the outer ring and another..
https://leetcode.com/problems/minimum-falling-path-sum-ii/description/Leetcode - Minimum Falling Path Sum II문제 유형 : 다이나믹 프로그래밍문제 난이도 : Hard 문제Given an n x n integer matrix grid, return the minimum sum of a falling path with non-zero shifts.A falling path with non-zero shifts is a choice of exactly one element from each row of grid such that no two elements chosen in adjacent rows are in the same..
https://leetcode.com/problems/longest-ideal-subsequence/description/Leetcode - Longest Ideal Subsequence문제 유형 : 다이나믹 프로그래밍, 문자열처리문제 난이도 : Medium 문제You are given a string s consisting of lowercase letters and an integer k. We call a string t ideal if the following conditions are satisfied:t is a subsequence of the string s.The absolute difference in the alphabet order of every two adjacent letter..
https://leetcode.com/problems/minimum-height-trees/description/ Leetcode - Minimum Height Trees 문제 유형 : bfs / 위상 정렬 문제 난이도 : Medium 문제 A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles is a tree. Given a tree of n nodes labelled from 0 to n - 1, and an array of n - 1 edges where edges[i] = [ai, bi]..