목록LeetCode (568)
넘치게 채우기
https://leetcode.com/problems/minimum-array-end/description/?envType=daily-question&envId=2024-11-09leetcode - Minimum Array End문제 유형: 비트마스킹문제 난이도: Medium 문제You are given two integers n and x. You have to construct an array of positive integers nums of size n where for every 0 nums[i + 1] is greater than nums[i], and the result of the bitwise AND operation between all elements of nums is x.Retu..
https://leetcode.com/problems/maximum-xor-for-each-query/description/?envType=daily-question&envId=2024-11-08leetcode - Maximum XOR for Each Query문제 유형: 비트마스킹, 비트 조작, 부분합문제 난이도: Medium 문제You are given a sorted array nums of n non-negative integers and an integer maximumBit. You want to perform the following query n times:Find a non-negative integer k such that nums[0] XOR nums[1] XOR ... XOR nu..
https://leetcode.com/problems/largest-combination-with-bitwise-and-greater-than-zero/description/?envType=daily-question&envId=2024-11-07leetcode - Largest Combination With Bitwise AND Greater Than Zero문제 유형: 비트마스킹, 비트 조작문제 난이도: Medium 문제The bitwise AND of an array nums is the bitwise AND of all integers in nums.For example, for nums = [1, 5, 3], the bitwise AND is equal to 1 & 5 & 3 = 1.Also, f..
https://leetcode.com/problems/find-if-array-can-be-sorted/?envType=daily-question&envId=2024-11-06leetcode - Find if Array Can Be Sorted문제 유형: 정렬, 비트마스킹, 슬라이딩 윈도우문제 난이도: Medium 문제You are given a 0-indexed array of positive integers nums.In one operation, you can swap any two adjacent elements if they have the same number of set bits. You are allowed to do this operation any number of times (incl..
https://leetcode.com/problems/minimum-number-of-changes-to-make-binary-string-beautiful/description/?envType=daily-question&envId=2024-11-05leetcode - Minimum Number of Changes to Make Binary String Beautiful문제 유형: 문자열 처리, 그리디문제 난이도: Medium 문제You are given a 0-indexed binary string s having an even length.A string is beautiful if it's possible to partition it into one or more substrings such tha..
https://leetcode.com/problems/string-compression-iii/description/?envType=daily-question&envId=2024-11-04leetcode - String Compression III문제 유형: 문자열 처리, 투 포인터문제 난이도: Medium 문제Given a string word, compress it using the following algorithm:Begin with an empty string comp. While word is not empty, use the following operation:Remove a maximum length prefix of word made of a single character c repeat..
https://www.acmicpc.net/problem/9251BOJ - LCS문제 유형: 문자열 처리, 재귀, 다이나믹 프로그래밍문제 난이도: Gold V시간 제한: 0.1초메모리 제한: 256MB 문제LCS(Longest Common Subsequence, 최장 공통 부분 수열)문제는 두 수열이 주어졌을 때, 모두의 부분 수열이 되는 수열 중 가장 긴 것을 찾는 문제이다.예를 들어, ACAYKP와 CAPCAK의 LCS는 ACAK가 된다. 입력첫째 줄과 둘째 줄에 두 문자열이 주어진다. 문자열은 알파벳 대문자로만 이루어져 있으며, 최대 1000글자로 이루어져 있다. 출력첫째 줄에 입력으로 주어진 두 문자열의 LCS의 길이를 출력한다. 풀이dp[i1][i2]는 첫 번째 문자열의 i1인덱스부터의 부분문자..
https://leetcode.com/problems/rotate-string/description/?envType=daily-question&envId=2024-11-03leetcode - Rotate String문제 유형: 문자열 처리, 완전 탐색문제 난이도: Easy 문제Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s.A shift on s consists of moving the leftmost character of s to the rightmost position.For example, if s = "abcde", then it will be "bcd..
https://leetcode.com/problems/circular-sentence/description/?envType=daily-question&envId=2024-11-02leetcode - Circular Sentence문제 유형: 문자열 처리, 배열문제 난이도: Easy 문제A sentence is a list of words that are separated by a single space with no leading or trailing spaces.For example, "Hello World", "HELLO", "hello world hello world" are all sentences.Words consist of only uppercase and lowercase English l..
https://leetcode.com/problems/delete-characters-to-make-fancy-string/description/?envType=daily-question&envId=2024-11-01leetcode - Delete Characters to Make Fancy String문제 유형: 문자열 처리문제 난이도: Easy 문제A fancy string is a string where no three consecutive characters are equal.Given a string s, delete the minimum possible number of characters from s to make it fancy.Return the final string after the ..