You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| 0452 |[Minimum Number of Arrows to Burst Balloons](src/main/ts/g0401_0500/s0452_minimum_number_of_arrows_to_burst_balloons/solution.ts)| Medium | Array, Sorting, Greedy | 75 | 98.54
| 0199 |[Binary Tree Right Side View](src/main/ts/g0101_0200/s0199_binary_tree_right_side_view/solution.ts)| Medium | Top_100_Liked_Questions, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 0 | 100.00
1166
+
| 0637 |[Average of Levels in Binary Tree](src/main/ts/g0601_0700/s0637_average_of_levels_in_binary_tree/solution.ts)| Easy | Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 0 | 100.00
1164
1167
| 0102 |[Binary Tree Level Order Traversal](src/main/ts/g0101_0200/s0102_binary_tree_level_order_traversal/solution.ts)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Breadth_First_Search, Tree, Binary_Tree, Big_O_Time_O(N)_Space_O(N) | 0 | 100.00
1165
1168
| 0103 |[Binary Tree Zigzag Level Order Traversal](src/main/ts/g0101_0200/s0103_binary_tree_zigzag_level_order_traversal/solution.ts)| Medium | Top_Interview_Questions, Breadth_First_Search, Tree, Binary_Tree | 0 | 100.00
| 0230 |[Kth Smallest Element in a BST](src/main/ts/g0201_0300/s0230_kth_smallest_element_in_a_bst/solution.ts)| Medium | Top_100_Liked_Questions, Depth_First_Search, Tree, Binary_Tree, Binary_Search_Tree, Big_O_Time_O(n)_Space_O(n) | 0 | 100.00
| 0215 |[Kth Largest Element in an Array](src/main/ts/g0201_0300/s0215_kth_largest_element_in_an_array/solution.ts)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Heap_Priority_Queue, Divide_and_Conquer, Quickselect, Big_O_Time_O(n\*log(n))_Space_O(log(n)) | 4 | 99.64
| 0373 |[Find K Pairs with Smallest Sums](src/main/ts/g0301_0400/s0373_find_k_pairs_with_smallest_sums/solution.ts)| Medium | Array, Heap_Priority_Queue | 42 | 85.15
1242
1249
| 0295 |[Find Median from Data Stream](src/main/ts/g0201_0300/s0295_find_median_from_data_stream/solution.ts)| Hard | Top_100_Liked_Questions, Sorting, Two_Pointers, Design, Heap_Priority_Queue, Data_Stream, Big_O_Time_O(n\*log_n)_Space_O(n) | 106 | 92.31
| 0452 |[Minimum Number of Arrows to Burst Balloons](src/main/ts/g0401_0500/s0452_minimum_number_of_arrows_to_burst_balloons/solution.ts)| Medium | Array, Sorting, Greedy, Top_Interview_150_Intervals | 75 | 98.54
1752
1765
| 0438 |[Find All Anagrams in a String](src/main/ts/g0401_0500/s0438_find_all_anagrams_in_a_string/solution.ts)| Medium | Top_100_Liked_Questions, String, Hash_Table, Sliding_Window, Algorithm_II_Day_5_Sliding_Window, Programming_Skills_II_Day_12, Level_1_Day_12_Sliding_Window/Two_Pointer, Big_O_Time_O(n+m)_Space_O(1) | 8 | 97.80
1753
1766
| 0437 |[Path Sum III](src/main/ts/g0401_0500/s0437_path_sum_iii/solution.ts)| Medium | Depth_First_Search, Tree, Binary_Tree, Level_2_Day_7_Tree, Big_O_Time_O(n)_Space_O(n) | 3 | 86.41
There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array `points` where <code>points[i] = [x<sub>start</sub>, x<sub>end</sub>]</code> denotes a balloon whose **horizontal diameter** stretches between <code>x<sub>start</sub></code> and <code>x<sub>end</sub></code>. You do not know the exact y-coordinates of the balloons.
6
+
7
+
Arrows can be shot up **directly vertically** (in the positive y-direction) from different points along the x-axis. A balloon with <code>x<sub>start</sub></code> and <code>x<sub>end</sub></code> is **burst** by an arrow shot at `x` if <code>x<sub>start</sub> <= x <= x<sub>end</sub></code>. There is **no limit** to the number of arrows that can be shot. A shot arrow keeps traveling up infinitely, bursting any balloons in its path.
8
+
9
+
Given the array `points`, return _the **minimum** number of arrows that must be shot to burst all balloons_.
10
+
11
+
**Example 1:**
12
+
13
+
**Input:** points = [[10,16],[2,8],[1,6],[7,12]]
14
+
15
+
**Output:** 2
16
+
17
+
**Explanation:** The balloons can be burst by 2 arrows:
18
+
19
+
- Shoot an arrow at x = 6, bursting the balloons [2,8] and [1,6].
20
+
21
+
- Shoot an arrow at x = 11, bursting the balloons [10,16] and [7,12].
22
+
23
+
**Example 2:**
24
+
25
+
**Input:** points = [[1,2],[3,4],[5,6],[7,8]]
26
+
27
+
**Output:** 4
28
+
29
+
**Explanation:** One arrow needs to be shot for each balloon for a total of 4 arrows.
30
+
31
+
**Example 3:**
32
+
33
+
**Input:** points = [[1,2],[2,3],[3,4],[4,5]]
34
+
35
+
**Output:** 2
36
+
37
+
**Explanation:** The balloons can be burst by 2 arrows:
38
+
39
+
- Shoot an arrow at x = 2, bursting the balloons [1,2] and [2,3].
40
+
41
+
- Shoot an arrow at x = 4, bursting the balloons [3,4] and [4,5].
Suppose LeetCode will start its **IPO** soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital before the **IPO**. Since it has limited resources, it can only finish at most `k` distinct projects before the **IPO**. Help LeetCode design the best way to maximize its total capital after finishing at most `k` distinct projects.
6
+
7
+
You are given `n` projects where the <code>i<sup>th</sup></code> project has a pure profit `profits[i]` and a minimum capital of `capital[i]` is needed to start it.
8
+
9
+
Initially, you have `w` capital. When you finish a project, you will obtain its pure profit and the profit will be added to your total capital.
10
+
11
+
Pick a list of **at most**`k` distinct projects from given projects to **maximize your final capital**, and return _the final maximized capital_.
12
+
13
+
The answer is guaranteed to fit in a 32-bit signed integer.
14
+
15
+
**Example 1:**
16
+
17
+
**Input:** k = 2, w = 0, profits = [1,2,3], capital = [0,1,1]
18
+
19
+
**Output:** 4
20
+
21
+
**Explanation:**
22
+
23
+
Since your initial capital is 0, you can only start the project indexed 0.
24
+
25
+
After finishing it you will obtain profit 1 and your capital becomes 1.
26
+
27
+
With capital 1, you can either start the project indexed 1 or the project indexed 2.
28
+
29
+
Since you can choose at most 2 projects, you need to finish the project indexed 2 to get the maximum capital.
30
+
31
+
Therefore, output the final maximized capital, which is 0 + 1 + 3 = 4.
32
+
33
+
**Example 2:**
34
+
35
+
**Input:** k = 3, w = 0, profits = [1,2,3], capital = [0,1,2]
* The number of nodes in the tree is in the range <code>[2, 10<sup>4</sup>]</code>.
26
+
* <code>0 <= Node.val <= 10<sup>5</sup></code>
27
+
28
+
**Note:** This question is the same as 783: [https://leetcode.com/problems/minimum-distance-between-bst-nodes/](https://leetcode.com/problems/minimum-distance-between-bst-nodes/)
Given the `root` of a binary tree, return _the average value of the nodes on each level in the form of an array_. Answers within <code>10<sup>-5</sup></code> of the actual answer will be accepted.
**Output:**[3.00000,14.50000,11.00000] Explanation: The average value of nodes on level 0 is 3, on level 1 is 14.5, and on level 2 is 11. Hence return [3, 14.5, 11].
0 commit comments