목록전체 글 (42)
mjk study log
문제Given an encoded string, return its decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer.You may assume that the input string is always valid; there are no extra white spaces, square brackets are well-formed, etc. Furthermore, you may assume that the orig..
문제Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list.The first node is considered odd, and the second node is even, and so on.Note that the relative order inside both the even and odd groups should remain as it was in the input.You must solve the problem in O(1) extra space complexity and O(..
문제Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. Example 1:Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the right: [7,1,2,3,4,5,6] rotate 2 steps to the right: [6,7,1,2,3,4,5] rotate 3 steps to the right: [5,6,7,1,2,3,4] Example 2:Input: nums = [-1,-100,3,99], k = 2 Output: [3,99,-1,-100] Explanation:..
문제Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.You must write an algorithm that runs in O(n) time. Example 1:Input: nums = [100,4,200,1,3,2]Output: 4Explanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefore its length is 4.Example 2:Input: nums = [0,3,7,2,5,8,4,6,0,1]Output: 9Example 3:Input: nums = [1,0,1,2]Outp..

문제 Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2.An interleaving of two strings s and t is a configuration where s and t are divided into n and m substrings respectively, such that:s = s1 + s2 + ... + snt = t1 + t2 + ... + tm|n - m| The interleaving is s1 + t1 + s2 + t2 + s3 + t3 + ... or t1 + s1 + t2 + s2 + t3 + s3 + ...Note: a + b is the concatenation ..

문제You are given the head of a linked list with n nodes.For each node in the list, find the value of the next greater node. That is, for each node, find the value of the first node that is next to it and has a strictly larger value than it.Return an integer array answer where answer[i] is the value of the next greater node of the ith node (1-indexed). If the ith node does not have a next greater ..

Today, I will write a simple blog on my experience taking a KISA Information Security Engineer Certificate test and how I passed the theoretical test. What is the KISA Information Security Certificate (정보보안기사 자격증)?The KISA Information Security Certificate, issued by the Korea Internet & Security Agency, verifies that organizations in South Korea meet specific information security standards. It h..

What is hash collision?Hash collision happens when the different keys (inputs of the hash function) have the same hash value. Simply, it means the hash code is not unique. SSH & CodeWhen you log Into the server, you can realize that your current uid is col. This means you must use a col file to execute, but you can read col.c. Let's look into the col.c file:In the main function, the first if st..
Useful tip) always use "man" to find the options:man Web ServerTo connect to the internet from your computer, your browser needs to communicate to a web server over protocols like HTTP. How do we create web servers? - there are several methods:python3 -m http.server [port] # python 3 server# http web server with npmnpm install http-serverhttp-server -p [port]# http web server with phpphp -S [a..
Useful tip) always use "man" to find the options: man Package Management You might have used "apt install" or "apt update" to download files or update the versions. As you can assume, apt is the command to manage packages. Then what's the difference between the commands "dpkg"? APT apt stands for "advanced package manager" high-level command-line interface apt is a newer version of "apt-get" apt..