전체 글

전체 글

    [LeetCode] 627. Swap Salary

    627. Swap Salary Easy SQL Schema Table: Salary +-------------+----------+ | Column Name | Type | +-------------+----------+ | id | int | | name | varchar | | sex | ENUM | | salary | int | +-------------+----------+ id is the primary key for this table. The sex column is ENUM value of type ('m', 'f'). The table contains information about an employee. Write an SQL query to swap all 'f' and 'm' val..

    [LeetCode] 1873. Calculate Special Bonus

    1873. Calculate Special Bonus Easy SQL Schema Table: Employees +-------------+---------+ | Column Name | Type | +-------------+---------+ | employee_id | int | | name | varchar | | salary | int | +-------------+---------+ employee_id is the primary key for this table. Each row of this table indicates the employee ID, employee name, and salary. Write an SQL query to calculate the bonus of each em..

    [LeetCode] 796. Rotate String

    796. Rotate String Easy Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s. A shift on s consists of moving the leftmost character of s to the rightmost position. For example, if s = "abcde", then it will be "bcdea" after one shift. Example 1: Input: s = "abcde", goal = "cdeab" Output: true Example 2: Input: s = "abcde", goal = "abced" Out..

    [LeetCode] 487. Max Consecutive Ones II

    487. Max Consecutive Ones II Medium Given a binary array nums, return the maximum number of consecutive 1's in the array if you can flip at most one 0. Example 1: Input: nums = [1,0,1,1,0] Output: 4 Explanation: - If we flip the first zero, nums becomes [1,1,1,1,0] and we have 4 consecutive ones. - If we flip the second zero, nums becomes [1,0,1,1,1] and we have 3 consecutive ones. The max numbe..

    [SPOTER] Sign Pose-based Transformer 사용법과 에러들

    [SPOTER] Sign Pose-based Transformer 사용법과 에러들

    Torch를 Import 시킬 수 없는 에러를 해결하는 방법? ImportError: cannot import name 'TypeAlias' from 'typing_extensions' (/opt/ohpc/pub/apps/python3/3.8.8/lib/python3.8/site-packages/typing_extensions.py) Torch Version이 1.13.0 최신 버전이었는데, 이게 문제가 있어서 다운그레이드 해야한다. python3 -m pip uninstall torch pytorch를 삭제하고 버전을 낮춰 설치한다. pip3 install torch==1.8.1 torchvision을 설치하게되면 torch 버전이 낮아서 torch 버전을 업데이트 해버리게 되니, torchvisio..

    [LeetCode] 140. Word Break II

    140. Word Break II Hard Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences in any order. Note that the same word in the dictionary may be reused multiple times in the segmentation. Example 1: Input: s = "catsanddog", wordDict = ["cat","cats","and","sand","dog"] Output: ["cat..

    [LeetCode] 139. Word Break

    139. Word Break Medium Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. Note that the same word in the dictionary may be reused multiple times in the segmentation. Example 1: Input: s = "leetcode", wordDict = ["leet","code"] Output: true Explanation: Return true because "leetcode" can be segm..

    PCA Dimensionality Reduction이란? PCA란?

    PCA Dimensionality Reduction이란? PCA란?

    PCA(Principle Component Analysis)란? 데이터 세트를 기반으로 새로운 직교(Orthogonal) Feature 백터세트를 찾는 방법인데, 이 벡터는 Feature 백터나 Dimension 에서 최대로 확산될 수 있는 데이터를 의미한다. PCA는 데이터의 분산이나 퍼지는 정도에 따라 감소하는 순서로 Feature 백터의 등급을 매긴다. 데이터 포인터들(datapoints)은 첫번째 Feature 백터에서 최대 분산 값을 가진다. 그리고 가장 마지막 Feature 백터에서 최소 분산 값을 가진다. Feature 백터에서 데이터포인트들의 분산은 방향(Direction)의 정보를 측정이라고 할 수 있다. 과정 데이터 포인트들을 표준화한다. 주어진 데이터 포인트들로 부터 공분산(Covar..