- Today
- Total
목록스터디/코테 (223)
작심삼일
문제 링크: https://leetcode.com/problems/sum-of-even-numbers-after-queries/ 문제 You are given an integer array nums and an array queries where queries[i] = $[val_i, index_i].$ For each query i, first, apply $nums[index_i] = nums[index_i]+val_i$, then print the sum of the even values of nums. Return an integer array answer where answer[i] is the answer to the $i^{th}$ query. 조건 1
문제 링크: https://leetcode.com/problems/maximum-length-of-repeated-subarray/ 문제 Given two integer arrays nums1 and nums2, return the maximum length of a subarray that appears in both arrays. 조건 1
문제 링크: https://leetcode.com/problems/find-duplicate-file-in-system/ 문제 Given a list paths of directory info, including the directory path, and all the files with contents in this directory, return all the duplicate files in the file system in terms of their paths. You may return the answer in any order. A group of duplicate files consists of at least two files that have the same content. A singl..
문제 링크: https://leetcode.com/problems/find-original-array-from-doubled-array/ 문제 An integer array original is transformed into a doubled array changed by appending twice the value of every element in original, and then randomly shuffling the resulting array. Given an array changed, return original if changed is a doubled array. If changed is not a doubled array, return an empty array. The element..
문제 링크: https://leetcode.com/problems/pseudo-palindromic-paths-in-a-binary-tree/ 문제 Given a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the path is a palindrome. Return the number of pseudo-palindromic paths going from the root node to leaf nodes. 조건 The number of nodes in the tr..
문제 링크: https://leetcode.com/problems/binary-tree-inorder-traversal/ 문제 Given the root of a binary tree, return the inorder traversal of its nodes' values. 조건 The number of nodes in the tree is in the range [0, 100]. -100
문제 링크: https://leetcode.com/problems/construct-string-from-binary-tree/ 문제 Given the root of a binary tree, construct a string consisting of parenthesis and integers from a binary tree with the preorder traversal way, and return it. Omit all the empty parenthesis pairs that do not affect the one-to-one mapping relationship between the string and the original binary tree. 조건 The number of nodes i..
문제 링크: https://leetcode.com/problems/binary-tree-pruning/ 문제 Given the root of a binary tree, return the same tree where every subtree (of the given tree) not containing a 1 has been removed. A subtree of a node node is node plus every node that is a descendant of node. 조건 The number of nodes in the tree is in the range [1, 200]. Node.val is either 0 or 1. 내 풀이 Tree 구조 관련 문제는 recursive하게 짠다. dfs..