PS

    LeetCode / Linked List / 142번 / Linked List Cycle II / JS

    Linked List Cycle II - LeetCode Can you solve this real interview question? Linked List Cycle II - Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there is some node in the list that can be r leetcode.com 순환을 할 수도 있고, 순환하지 않을 수도 있는 Linked List가 주어진다. 만약 어딘가의 위치에서 순환이 이루어지고 있는 ..

    LeetCode / Linked List / 876번 / Middle of Linked List / JS

    Middle of the Linked List - LeetCode Can you solve this real interview question? Middle of the Linked List - Given the head of a singly linked list, return the middle node of the linked list. If there are two middle nodes, return the second middle node. Example 1: [https://assets.leetcode. leetcode.com 여러개의 노드로 연결된 linked list에서 중간 노드를 반환하면 되는 문제이다. 만약 노드의 개수가 짝수라면 중간 노드의 ..

    백준 / 백트래킹 / 15654번 / N과 M (5) / JS

    15654번: N과 M (5) N개의 자연수와 자연수 M이 주어졌을 때, 아래 조건을 만족하는 길이가 M인 수열을 모두 구하는 프로그램을 작성하시오. N개의 자연수는 모두 다른 수이다. N개의 자연수 중에서 M개를 고른 수열 www.acmicpc.net /* N과 M (5) */ const fs = require('fs'); // const filePath = process.platform === 'linux' ? '/dev/stdin' : '../input.txt'; const filePath = process.platform === 'linux' ? '/dev/stdin' : 'BOJ/input.txt'; const input = fs.readFileSync(filePath).t..

    LeetCode / Linked List / 206번 / Reverse Linked List / JS

    Reverse Linked List - LeetCode Can you solve this real interview question? Reverse Linked List - Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: [https://assets.leetcode.com/uploads/2021/02/19/rev1ex1.jpg] Input: head = [1,2,3,4,5] O leetcode.com 주어진 Linked List의 노드의 순서를 반대로 바꾸면 되는 문제이다. /** * Definition for singly-linked..

    LeetCode / Linked List / 21번 / Merge Two Sorted Lists / JS

    Merge Two Sorted Lists - LeetCode Can you solve this real interview question? Merge Two Sorted Lists - You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two lists leetcode.com 주어진 두개의 Linked List를 하나의 List로 Merge하여 오름차순으로 정렬하면 되는 문제이다. /** * Defi..

    LeetCode / String /392번 / Is Subsequence / JS

    Is Subsequence - LeetCode Can you solve this real interview question? Is Subsequence - Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is formed from the original string by deleting some (can be n leetcode.com 문자열로 s와 t가 주어진다. 이때 주어진 s의 각각 문자가 s에서의 순서를 지키면서 t에 속하는지 판단하면 되는 문제이다. 예를들어 s =..