일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- 카드뉴스
- 비트연산자
- programmers
- 제로베이스 프론트엔드 스쿨
- 정규표현식
- react-query
- 디자인
- 웹접근성
- 알고리즘
- JavaScript
- html&css
- TypeScript
- leetcode
- react
- wai-aria
- 프로그래머스
- Today
- Total
목록FRONTEND STUDY (51)
記錄

문제 링크: https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/ 난이도: Medium Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 두 개의 문자열 needle과 haystack이 주어지면, haystack에서 needle이 처음 나타나는 index를 반환하거나, needle이 haystack의 일부가 아닌 경우 -1을 반환합니다. Example 1: Input: haystack = "sadbutsad"..

문제 링크: https://leetcode.com/problems/valid-parentheses/ 난이도: Easy Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of the same type. '..

문제 링크: https://leetcode.com/problems/triangle/ 난이도: Medium Given a triangle array, return the minimum path sum from top to bottom. For each step, you may move to an adjacent number of the row below. More formally, if you are on index i on the current row, you may move to either index i or index i + 1 on the next row. 삼각형 배열이 주어지면 위에서 아래로 최소 경로 합계를 반환합니다. 각 단계에 대해 아래 행의 인접한 번호로 이동할 수 있습니다. 보다 공식적..

이 글은 JavaScript에서 자주 사용되는 map, reduce, filter 메소드에 대해 정리한 글입니다. 01 Array.map() -배열 내의 모든 요소 각각에 대하여 주어진 함수를 호출한 결과를 모아 새로운 배열을 반환(기존의 배열 수정하지 않음) -각각의 요소에 대해 한번씩 순서대로 불러 그 함수의 반환값으로 새로운 배열을 만듦 arr.map(callback(currentValue[, index[, array]])[, thisArg]) 배열.map((요소, 인덱스, 배열) => { return 요소}); callbackFunction, thisArg 두개의 매개변수가 있고 callbackFunction은 currentValue, index, array 3개의 매개변수 가짐 currentVa..

00. 에라토스테네스의 체란 에라토스테네스의 체(Sieve of Eratosthenes) 란 고대 그리스의 수학자 에라토스테네스가 만들어 낸 소수(prime number)를 찾는 방법으로, 마치 체로 치듯이 수를 걸러낸다고 하여 이러한 이름이 붙여졌다. 가장 대표적인 소수 판별 알고리즘으로, 2 이상 n 이하의 정수 x가 소수인지 아닌지 효율적으로 판단할 수 있도록 추가적인 배열을 만드는 전처리 알고리즘이다. 소수(prime number)는 1과 그 수 자신 이외의 자연수로는 나눌 수 없는 양의 정수로 2,3,5,7,11...등의 숫자들이 소수에 속한다. 1. 2부터 소수를 구하고자 하는 구간의 모든 수를 나열한다. 그림에서 회색 사각형으로 두른 수들이 여기에 해당한다. 2. 2는 소수이므로 오른쪽에 2..

이 글은 완전 탐색의 개념과 완전 탐색 기법을 활용한 알고리즘의 종류들을 간략하게 정리하고, 순열과 조합을 메인으로 설명한다. 01 경우의 수 Number of Cases 경우의 수(境遇─數, number of cases)란, 어떤 사건(일)이 일어날 수 있는 경우의 가짓수(outcomes)를 수로 표현한 것이다. 1회의 시행에서 일어날 수 있는 사건의 가짓수를 n이라고 할 때 이 때의 경우의 수를 n이라고 한다. 각 사건이 일어날 확률들의 관계를 알 수 있다면 경우의 수를 통해 각 확률을 구할 수 있기 때문에 완전탐색 알고리즘에서 사용된다. 02 완전 탐색 Exhaustive search 완전 탐색이란 모든 경우의 수를 나열하는 방식으로 답을 구하는 방법이다. '무식하게 푼다'라는 의미인 Brute-F..

문제 링크: https://leetcode.com/problems/lexicographical-numbers/ 난이도: Medium Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order. You must write an algorithm that runs in O(n) time and uses O(1) extra space. 정수 n이 주어지면 사전순으로 정렬된 [1, n] 범위의 모든 숫자를 반환합니다. O(n) 시간 내에 실행되며 O(1) 여유 공간을 사용하는 알고리즘을 작성해야 합니다. Example 1: Input: n = 13 Output: [1,10,11,12,13,2,3,4,5..

문제 링크: https://leetcode.com/problems/sort-the-people/ 난이도: Easy You are given an array of strings names, and an array heights that consists of distinct positive integers. Both arrays are of length n. For each index i, names[i] and heights[i] denote the name and height of the ith person. Return names sorted in descending order by the people's heights. Example 1: Input: names = ["Mary","John","Emm..