Python

    [LeetCode] 2816. Double a Number Represented as a Linked List (Daily Question)

    문제You are given the head of a non-empty linked list representing a non-negative integer without leading zeroes.Return the head of the linked list after doubling it. 연결 리스트의 head가 주어졌을 때 쭉 이어서 만든 숫자의 두배를 만드는 만드는 문제이다.[1, 2, 3]이 주어졌을 때 123 * 2 => 246 => [2, 4, 6]의 과정을 거친다.연결 리스트는 객체 형식으로 주어지고 값을 의미하는 node.val, 다음 노드를 가리키는 node.next이 맴버변수로 존재한다. Example 1:Input: head = [1,8,9]Output: [3,7,8] Explan..

    [LeetCode] 165. Compare Version Numbers (Daily Question)

    문제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. Revisions are 0-indexed from left to right, with the leftmost revision being revision 0, the next revision being revision 1, and so on. For example 2.5..

    [LeetCode] 2441. Largest Positive Integer That Exists With Its Negative (Daily Question)

    문제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, return -1. 정수 리스트 nums가 주어졌을 때 음수도 들어있는 양수의 최대값을 찾는 문제이다. Example 1:Input: nums = [-1,2,-3,3] Output: 3 Explanation: 3 is the only valid k we can find in the array.Example 2:Input: nums = [-1,10,6,7,-7..

    [LeetCode] 2000. Reverse Prefix of Word (Daily Question)

    문제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 = "d", then you should reverse the segment that starts at 0 and ends at 3 (inclusive). The resulting string will be "dcbaefd".Return th..

    [LeetCode] 2997. Minimum Number of Operations to Make Array XOR Equal to K (Daily Question)

    문제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 its binary representation. Flipping a bit means changing a 0 to 1 or vice versa.Return the minimum number of operations required to make the bitwise XOR of all elements of the final array equal to k...

    [LeetCode] 514. Freedom Trail (Daily Question)

    문제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 string key that represents the keyword that needs to be spelled, return the minimum number of steps to spell all the chara..