[python] 34. Find First and Last Position of Element in Sorted Array
더보기 Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity. Example 1: Input: nums = [5,7,7,8,8,10], target = 8 Output: [3,4] Example 2: Input: nums = [5,7,7,8,8,10], target = 6 Output: [-1,-1] Example 3: Input:..
[c++][LeetCode Curated Algo 170][314. Binary Tree Vertical Order Traversal]
문제 Given the root of a binary tree, return the vertical order traversal of its nodes' values. (i.e., from top to bottom, column by column). If two nodes are in the same row and column, the order should be from left to right. Input: root = [3,9,8,4,0,1,7,null,null,null,2,5] Output: [[4],[9,5],[3,0,1],[8,2],[7]] Input: root = [3,9,20,null,null,15,7] Output: [[9],[3,15],[20],[7]] 한줄해석 위와 같은 tree 구조..