반응형
전체 글

전체 글

    [리트코드] 11. Container With Most Water / Javascript

    [리트코드] 11. Container With Most Water / Javascript

    문제주소 :https://leetcode.com/problems/container-with-most-water/ Container With Most Water - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 더보기 Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that t..

    [프로그래머스] 전력망을 둘로 나누기 / Javascript

    [프로그래머스] 전력망을 둘로 나누기 / Javascript

    문제주소 :https://programmers.co.kr/learn/courses/30/lessons/86971 코딩테스트 연습 - 9주차 9 [[1,3],[2,3],[3,4],[4,5],[4,6],[4,7],[7,8],[7,9]] 3 7 [[1,2],[2,7],[3,7],[3,4],[4,5],[6,7]] 1 programmers.co.kr 더보기 문제 설명 n개의 송전탑이 전선을 통해 하나의 트리 형태로 연결되어 있습니다. 당신은 이 전선들 중 하나를 끊어서 현재의 전력망 네트워크를 2개로 분할하려고 합니다. 이때, 두 전력망이 갖게 되는 송전탑의 개수를 최대한 비슷하게 맞추고자 합니다. 송전탑의 개수 n, 그리고 전선 정보 wires가 매개변수로 주어집니다. 전선들 중 하나를 끊어서 송전탑 개수가 가..

    [Javascript] this 바인딩 규칙

    [Javascript] this 바인딩 규칙

    이 글은 You Don't Know JS - this와 객체 프로토타입, 비동기와 성능 책을 읽고 정리한 내용입니다. 0. 서론 this는 기본적으로 호출부(함수가 어떻게 호출됐는가?)에서 함수를 호출할 때 바인딩 된다. 즉, 함수 호출이 이뤄지는 부분을 확인해야 '현재 context에서 this가 가리키는 것'이 무엇인지 확실하게 알 수 있는 것이다. 단순히 '함수를 호출한 지점'으로 돌아가면 호출부를 확인할 수 있다고 생각할 수 있지만, 코드의 복잡도에 따라 '진짜' 호출부를 찾는 것은 모호할 때가 많다. 따라서, 중요한 것은 호출 스택(현재 실행 지점에 오기까지 호출된 함수의 스택)을 생각해보는 것이다. 이 중 호출부는 현재 실행 중인 함수 '직전'의 호출 코드 '내부'에 있다. function f..

    [리트코드] 967. Numbers With Same Consecutive Differences / Javascript

    [리트코드] 967. Numbers With Same Consecutive Differences / Javascript

    문제주소 : https://leetcode.com/problems/numbers-with-same-consecutive-differences/ Numbers With Same Consecutive Differences - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 더보기 Return all non-negative integers of length n such that the absolute difference between every two consecuti..

    [리트코드] 1306. Jump Game III / Javascript

    [리트코드] 1306. Jump Game III / Javascript

    문제주소 :https://leetcode.com/problems/jump-game-iii/ Jump Game III - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 더보기 1306. Jump Game III Medium 165342Add to ListShare Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you a..

    [리트코드] 45. Jump Game II / Javascript

    [리트코드] 45. Jump Game II / Javascript

    문제주소 :https://leetcode.com/problems/jump-game-ii/ 더보기 45. Jump Game II Medium 5835222Add to ListShare Given an array of non-negative integers nums, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum number of jumps. You can assume that you can always reac..

    [프로그래머스] 최소직사각형(위클리챌린지 8주차) / Javascript

    [프로그래머스] 최소직사각형(위클리챌린지 8주차) / Javascript

    문제주소 :https://programmers.co.kr/learn/courses/30/lessons/86491 코딩테스트 연습 - 8주차 [[10, 7], [12, 3], [8, 15], [14, 7], [5, 15]] 120 [[14, 4], [19, 6], [6, 16], [18, 7], [7, 11]] 133 programmers.co.kr 더보기 문제 설명 명함 지갑을 만드는 회사에서 지갑의 크기를 정하려고 합니다. 다양한 모양과 크기의 명함들을 모두 수납할 수 있으면서, 작아서 들고 다니기 편한 지갑을 만들어야 합니다. 이러한 요건을 만족하는 지갑을 만들기 위해 디자인팀은 모든 명함의 가로 길이와 세로 길이를 조사했습니다. 아래 표는 4가지 명함의 가로 길이와 세로 길이를 나타냅니다. 명함 번..

    [프로그래머스] 빛의 경로 사이클 / Javascript

    [프로그래머스] 빛의 경로 사이클 / Javascript

    문제주소 :https://programmers.co.kr/learn/courses/30/lessons/86052# 코딩테스트 연습 - 빛의 경로 사이클 각 칸마다 S, L, 또는 R가 써져 있는 격자가 있습니다. 당신은 이 격자에서 빛을 쏘고자 합니다. 이 격자의 각 칸에는 다음과 같은 특이한 성질이 있습니다. 빛이 "S"가 써진 칸에 도달한 경우, 직진 programmers.co.kr 더보기 문제 설명 각 칸마다 S, L, 또는 R가 써져 있는 격자가 있습니다. 당신은 이 격자에서 빛을 쏘고자 합니다. 이 격자의 각 칸에는 다음과 같은 특이한 성질이 있습니다. 빛이 "S"가 써진 칸에 도달한 경우, 직진합니다. 빛이 "L"이 써진 칸에 도달한 경우, 좌회전을 합니다. 빛이 "R"이 써진 칸에 도달한 경..

    [리트코드] 336. Palindrome Pairs / Javascript

    [리트코드] 336. Palindrome Pairs / Javascript

    문제주소 : https://leetcode.com/problems/palindrome-pairs/ Palindrome Pairs - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 더보기 Given a list of unique words, return all the pairs of the distinct indices (i, j) in the given list, so that the concatenation of the two words words[i] + w..

    [프로그래머스] 없는 숫자 더하기 / Javascript

    [프로그래머스] 없는 숫자 더하기 / Javascript

    문제주소 :https://programmers.co.kr/learn/courses/30/lessons/86051 코딩테스트 연습 - 없는 숫자 더하기 0부터 9까지의 숫자 중 일부가 들어있는 배열 numbers가 매개변수로 주어집니다. numbers에서 찾을 수 없는 0부터 9까지의 숫자를 모두 찾아 더한 수를 return 하도록 solution 함수를 완성해주세요. 제한 programmers.co.kr 더보기 문제 설명 0부터 9까지의 숫자 중 일부가 들어있는 배열 numbers가 매개변수로 주어집니다. numbers에서 찾을 수 없는 0부터 9까지의 숫자를 모두 찾아 더한 수를 return 하도록 solution 함수를 완성해주세요. 제한사항 1 ≤ numbers의 길이 ≤ 9 0 ≤ numbers의..

반응형