본문 바로가기

반응형

리트코드/easy

(22)
[리트코드] 136. Single Number - js 1. 문제 https://leetcode.com/problems/single-number/submissions/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 2. 코드 /** * @param {number[]} nums * @return {number} */ var singleNumber = function(nums) { let map = new Map()..
[리트코드] 118. Pascal's Triangle - js 1. 문제 https://leetcode.com/problems/pascals-triangle/ Pascal's Triangle - LeetCode Can you solve this real interview question? Pascal's Triangle - Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: [https://upload.wikimedia.o leetcode.com 2. 코드 /** * @param {number} numRows * @return..
[리트코드] 206. Reverse Linked List - js 1. 문제 https://leetcode.com/problems/reverse-linked-list/ Reverse Linked List - LeetCode Can you solve this real interview question? Reverse Linked List - Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: [https://assets.leetcode.com/uploads/2021/02/19/rev1ex1.jpg] Input: head = [1,2,3,4,5] O leetcode.com 2. 코드 /** * Definition for singly-linked li..
[리트코드] 104. Maximum Depth of Binary Tree - js 1. 문제 https://leetcode.com/problems/maximum-depth-of-binary-tree/description/ Maximum Depth of Binary Tree - LeetCode Can you solve this real interview question? Maximum Depth of Binary Tree - Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf leetcode.com 2. 코드 /** * ..
[리트코드] 94. Binary Tree Inorder Traversal - js 1. 문제 https://leetcode.com/problems/binary-tree-inorder-traversal/description/ Binary Tree Inorder Traversal - LeetCode Can you solve this real interview question? Binary Tree Inorder Traversal - Given the root of a binary tree, return the inorder traversal of its nodes' values. Example 1: [https://assets.leetcode.com/uploads/2020/09/15/inorder_1.jpg] Input: root = [1,nu leetcode.com 2. 코드 /** *..
[리트코드] 226. Invert Binary Tree - js 1. 문제 https://leetcode.com/problems/invert-binary-tree/description/ Invert Binary Tree - LeetCode Can you solve this real interview question? Invert Binary Tree - Given the root of a binary tree, invert the tree, and return its root. Example 1: [https://assets.leetcode.com/uploads/2021/03/14/invert1-tree.jpg] Input: root = [4,2,7,1,3,6,9] Output: [4 leetcode.com 2. 코드 /** * Definition for a bina..

반응형