목록LeetCode (4)
wgrgwg-dev
841. Keys and RoomsThere are n rooms labeled from 0 to n - 1 and all the rooms are locked except for room 0. Your goal is to visit all the rooms. However, you cannot enter a locked room without having its key.When you visit a room, you may find a set of distinct keys in it. Each key has a number on it, denoting which room it unlocks, and you can take all of them with you to unlock the other room..
2095. Delete the Middle Node of a Linked ListYou are given the head of a linked list. Delete the middle node, and return the head of the modified linked list.The middle node of a linked list of size n is the ⌊n / 2⌋th node from the start using 0-based indexing, where ⌊x⌋ denotes the largest integer less than or equal to x.For n = 1, 2, 3, 4, and 5, the middle nodes are 0, 1, 1, 2, and 2, respect..
2390. Removing Stars From a StringYou are given a string s, which contains stars *.In one operation, you can:Choose a star in s.Remove the closest non-star character to its left, as well as remove the star itself.Return the string after all stars have been removed.Note:The input will be generated such that the operation is always possible.It can be shown that the resulting string will always be ..
1768. Merge Strings Alternatelyhttps://leetcode.com/problems/merge-strings-alternately문제You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.Return the merged string.Example 1:Input: word1 = "abc", word2 = "pqr"Output: "apbqcr"..