[LeetCode] 2570. Merge Two 2D Arrays by Summing Values (Python)
·
알고리즘/LeetCode
난이도: EasyProblem DescriptionYou are given two 2D integer arrays nums1 and nums2.nums1[i] = [idi, vali] indicate that the number with the id idi has a value equal to vali.nums2[i] = [idi, vali] indicate that the number with the id idi has a value equal to vali.Each array contains unique ids and is sorted in ascending order by id. Merge the two arrays into one array that is sorted in ascending ord..
[LeetCode] 2337. Move Pieces to Obtain a String (Python)
·
알고리즘/LeetCode
난이도: Medium문제 설명You are given two strings start and target, both of length n. Each string consists only of the characters 'L', 'R', and '_' where:The characters 'L' and 'R' represent pieces, where a piece 'L' can move to the left only if there is a blank space directly to its left, and a piece 'R' can move to the right only if there is a blank space directly to its right.The character '_' repres..
[LeetCode] 2825. Make String a Subsequence Using Cyclic Increments (Python)
·
알고리즘/LeetCode
난이도: Medium 문제 설명You are given two 0-indexed strings str1 and str2.In an operation, you select a set of indices in str1, and for each index i in the set, increment str1[i] to the next character cyclically. That is 'a' becomes 'b', 'b' becomes 'c', and so on, and 'z' becomes 'a'.Return true if it is possible to make str2 a subsequence of str1 by performing the operation at most once, and false ot..