profile
You only get one life. It's actually your duty to live it as fully as possible.
post-thumbnail

Leetcode - Contiguous Array

Problem Contiguous Array Given a binary array nums, return the maximum length of a contiguous subarray with an equal number of 0 and 1. Example 1: Example 2: Constraints: 1 <= nums.length <= 10⁵ nums[i] is either 0 or 1. Solution JavaScript

2022년 2월 4일
·
0개의 댓글
·
post-thumbnail

Leetcode - 4Sum II

Problem 4Sum II Given four integer arrays nums1, nums2, nums3, and nums4 all of length n, return the number of tuples (i, j, k, l) such that: 0 <= i, j, k, l < n nums1[i] + nums2[j] + nums3[k] + nums4[l] == 0 4개의 정수 배열 nums1, nums2, nums3, nums4 이 주어지고 모든 배열의 길이는 n 일때 다음과 같은 조건을 충족하는 tuples (i, j, k, l) 의 갯수를 구하시오 (간단히 말하면, 더해서 0이 될 수 있는 경우의 수를 구하시오) Example 1: Example 2: Constraints: `n == nu

2022년 2월 3일
·
0개의 댓글
·
post-thumbnail

Leetcode - Find All Anagrams in a String

Problem Find All Anagrams in a String Given two strings s and p, return an array of all the start indices of p's anagrams in s. You may return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example 1: Example 2: Constraints: 1 <= s.length, p.length <= 3 * 10⁴ `s

2022년 2월 2일
·
0개의 댓글
·
post-thumbnail

Leetcode - Rotate Array

Problem Rotate Array Given an array, rotate the array to the right by k steps, where k is non-negative. 주어진 배열을 k 단계만큼 회전 시키세요. k는 양수 입니다 Example 1: Example 2: Constraints: 1 <= nums.length <= 10⁵ -2³¹ <= nums[i] <= 2³¹ - 1 0 <= k <= 10⁵ Solution JavaScript Feedback은 언제나 환영입니다🤗

2022년 1월 30일
·
0개의 댓글
·
post-thumbnail

Leetcode - Maximum XOR of Two Numbers in an Array

Problem Maximum XOR of Two Numbers in an Array Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n. 정주로 이루어진 배열 nums가 주어질 때0 <= i <= j < n. 조건하에 nums[i] XOR nums[j]의 결과중 가장 큰 값을 구하시오. Example 1: Example 2: Constraints: 1 <= nums.length <= 2 * 10⁵ 0 <= nums[i] <= 2³¹ - 1 Solution JavaScript 첫번째 시도 안타깝게도 <span style="co

2022년 1월 27일
·
0개의 댓글
·
post-thumbnail

Leetcode - All Elements in Two Binary Search Trees

Problem All Elements in Two Binary Search Trees Given two binary search trees root1 and root2, return a list containing all the integers from both trees sorted in ascending order. 주어진 두 이진 검색 트리 root1, root2의 정수들이 오름차순으로 정렬된 하나의 리스트를 반환하시오 Example 1: Example 2: ![](https://images.velog.io/images

2022년 1월 26일
·
0개의 댓글
·
post-thumbnail

Leetcode - Koko Eating Bananas

Problem Koko Eating Bananas Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours. koko는 바나나 먹는것을 정말 좋아한다. n개의 바나나 더미가 있고, i번째 바나나 더미에는 piles[i]개의 바나나가 있다. 경비원들은 h시간이 지나면 돌아온다. Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less t

2022년 1월 20일
·
0개의 댓글
·
post-thumbnail

Leetcode - Binary Tree Level Order Traversal

Problem Binary Tree Level Order Traversal Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). 이진트리 root가 주어 졌을 때, 계층의 순서대로 순회하는 값을 구하시오. (좌측부터 우측으로, 계층별로) Example 1: Example 2: Example 3: Constraints: The number of node

2022년 1월 14일
·
0개의 댓글
·
post-thumbnail

Leetcode - Validate Binary Search Tree

Problem Validate Binary Search Tree Given the root of a binary tree, determine if it is a valid binary search tree (BST). 주어진 이진트리가 유효한 지 밝혀내라 A valid BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater than the node's key. Both the left and right subtrees must also be binary search tre

2022년 1월 4일
·
0개의 댓글
·
post-thumbnail

Leetcode - Longest Substring Without Repeating Characters

Problem Longest Substring Without Repeating Characters Given a string s, find the length of the longest substring without repeating characters. 주어진 문자열 s에서 반복되지 않는 가장 긴 문자열의 길이를 구해라 Example 1: Example 2: Example 3: Constraints: 0 <= s.length <= 5 * 104 s consists of English letters, digits, symbols and spaces. Solution JavaScript Feedback은 언제나 환영입니다🤗

2021년 12월 11일
·
0개의 댓글
·
post-thumbnail

Leetcode - Add Two Numbers

Problem Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. 양의 정수를 나타내는 비어있지 있지 않은 2개의 링크드 리스트가 주어진다. 숫자는 역순으로 저장되어 있으며, 각 노드는 하나의 숫자를 포함한다. 두 숫자의 합을 링크드 리스트로

2021년 11월 25일
·
0개의 댓글
·