LeetCode

    LeetCode / String /392번 / Is Subsequence / JS

    Is Subsequence - LeetCode Can you solve this real interview question? Is Subsequence - Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is formed from the original string by deleting some (can be n leetcode.com 문자열로 s와 t가 주어진다. 이때 주어진 s의 각각 문자가 s에서의 순서를 지키면서 t에 속하는지 판단하면 되는 문제이다. 예를들어 s =..

    LeetCode / String / 205번 / Isomorphic Strings / JS

    Isomorphic Strings - LeetCode Can you solve this real interview question? Isomorphic Strings - Given two strings s and t, determine if they are isomorphic. Two strings s and t are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replace leetcode.com 문자열 s와 t가 주어지면 둘이 같은 패턴을 가지는지 판단하여 return 하면되는 문제이다. 예를들어 egg와 add가 각각 s와 ..

    LeetCode / Prefix Sum / 724번 / Find Pivot Index / JS

    Find Pivot Index - LeetCode Can you solve this real interview question? Find Pivot Index - Given an array of integers nums, calculate the pivot index of this array. The pivot index is the index where the sum of all the numbers strictly to the left of the index is equal to the sum of leetcode.com nums 배열에서 한 index를 pivot으로 삼았을 때, 그 pivot의 왼쪽에 있는 값들을 다 더한 값과 오른쪽에 있는 값들을 다 더..

    LeetCode / Prefix Sum / 1480번 / Running Sum of 1d Array / JS

    Running Sum of 1d Array - LeetCode Can you solve this real interview question? Running Sum of 1d Array - Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums. Example 1: Input: nums = [1,2,3,4] Output: [1,3,6, leetcode.com nums 라는 배열이 주어지면 각 원소를 순회하면서 누적합을 구해서 return 해주면 되는 문제이다. /** * @param {nu..