분류 전체보기

    [LeetCode] 838. Push Dominoes

    [LeetCode] 838. Push Dominoes

    838. Push Dominoes Medium There are n dominoes in a line, and we place each domino vertically upright. In the beginning, we simultaneously push some of the dominoes either to the left or to the right. After each second, each domino that is falling to the left pushes the adjacent domino on the left. Similarly, the dominoes falling to the right push their adjacent dominoes standing on the right. W..

    [Machine Learning] Bias-Variance Tradeoff

    [Machine Learning] Bias-Variance Tradeoff

    Bias 란? 편향이라고 부르며, Model Prediction 평균과 Ground Truth 사이의 에러를 뜻한다. Estimated Function 의 Bias 는 값들을 예측할 수 있는 근본적인 모델의 용량을 알려준다. Ground Truth 란? 학습하고자 하는 데이터의 원본 혹은 실제 값이며, 우리의 모델이 원하는 답으로 예측해주길 바라는 이상적인 데이터를 뜻한다. Variance 란? 한국말로 분산이라고 하며, 주어진 데이터 셋을 위한 모델 예측안의 평균 Variability 이다. Variability 는 가변적인 상태 또는 특성이라고 할 수 있다. Estimated function 의 Variance 는 함수가 데이터 셋 안에서 얼마나 많이 변화를 조절할 수 있는 가를 말해준다. Bias ..

    [LeetCode] 985. Sum of Even Numbers After Queries

    985. Sum of Even Numbers After Queries Medium You are given an integer array nums and an array queries where queries[i] = [vali, indexi]. For each query i, first, apply nums[indexi] = nums[indexi] + vali, then print the sum of the even values of nums. Return an integer array answer where answer[i] is the answer to the ith query. Example 1: Input: nums = [1,2,3,4], queries = [[1,0],[-3,1],[-4,0],..

    [LeetCode] 298. Binary Tree Longest Consecutive Sequence

    [LeetCode] 298. Binary Tree Longest Consecutive Sequence

    298. Binary Tree Longest Consecutive Sequence Medium Given the root of a binary tree, return the length of the longest consecutive sequence path. A consecutive sequence path is a path where the values increase by one along the path. Note that the path can start at any node in the tree, and you cannot go from a node to its parent in the path. Example 1: Input: root = [1,null,3,2,4,null,null,null,..

    [LeetCode] 990. Satisfiability of Equality Equations

    990. Satisfiability of Equality Equations Medium You are given an array of strings equations that represent relationships between variables where each string equations[i] is of length 4 and takes one of two different forms: "xi==yi" or "xi!=yi".Here, xi and yi are lowercase letters (not necessarily different) that represent one-letter variable names. Return true if it is possible to assign integ..

    [LeetCode] 159. Longest Substring with At Most Two Distinct Characters

    159. Longest Substring with At Most Two Distinct Characters Medium Given a string s, return the length of the longest substring that contains at most two distinct characters. Example 1: Input: s = "eceba" Output: 3 Explanation: The substring is "ece" which its length is 3. Example 2: Input: s = "ccaabbb" Output: 5 Explanation: The substring is "aabbb" which its length is 5. Constraints: 1 2: cnt..

    [LeetCode] 1680. Concatenation of Consecutive Binary Numbers

    1680. Concatenation of Consecutive Binary Numbers Medium Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 109 + 7. Example 1: Input: n = 1 Output: 1 Explanation: "1" in binary corresponds to the decimal value 1. Example 2: Input: n = 3 Output: 27 Explanation: In binary, 1, 2, and 3 corresponds to "1", ..

    [LeetCode] 1272. Remove Interval

    [LeetCode] 1272. Remove Interval

    1272. Remove Interval Medium A set of real numbers can be represented as the union of several disjoint intervals, where each interval is in the form [a, b). A real number x is in the set if one of its intervals [a, b) contains x (i.e. a