|0436|Find Right Interval|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0436.Find-Right-Interval)|48.5%|Medium||
|0437|Path Sum III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0437.Path-Sum-III)|48.0%|Medium||
|0437|Path Sum III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0437.Path-Sum-III)|48.1%|Medium||
|0438|Find All Anagrams in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0438.Find-All-Anagrams-in-a-String)|44.8%|Medium||
|0439|Ternary Expression Parser||56.7%|Medium||
|0440|K-th Smallest in Lexicographical Order||29.8%|Hard||
|0771|Jewels and Stones|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0771.Jewels-and-Stones)|86.9%|Easy||
|0772|Basic Calculator III||43.4%|Hard||
|0773|Sliding Puzzle||60.7%|Hard||
@@ -958,7 +958,7 @@
|0818|Race Car||39.8%|Hard||
|0819|Most Common Word|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0819.Most-Common-Word)|45.5%|Easy||
|0820|Short Encoding of Words||51.5%|Medium||
|0821|Shortest Distance to a Character||68.0%|Easy||
|0821|Shortest Distance to a Character||68.2%|Easy||
|0822|Card Flipping Game||43.6%|Medium||
|0823|Binary Trees With Factors||36.5%|Medium||
|0824|Goat Latin||66.4%|Easy||
@@ -1101,7 +1101,7 @@
|0961|N-Repeated Element in Size 2N Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0961.N-Repeated-Element-in-Size-2N-Array)|74.4%|Easy||
|0962|Maximum Width Ramp||46.5%|Medium||
|0963|Minimum Area Rectangle II||51.8%|Medium||
|0964|Least Operators to Express Number||44.9%|Hard||
|0964|Least Operators to Express Number||45.0%|Hard||
|0965|Univalued Binary Tree||67.8%|Easy||
|0966|Vowel Spellchecker||47.9%|Medium||
|0967|Numbers With Same Consecutive Differences||44.7%|Medium||
@@ -1257,7 +1257,7 @@
|1117|Building H2O||53.1%|Medium||
|1118|Number of Days in a Month||57.6%|Easy||
|1119|Remove Vowels from a String||90.5%|Easy||
|1120|Maximum Average Subtree||63.6%|Medium||
|1120|Maximum Average Subtree||63.5%|Medium||
|1121|Divide Array Into Increasing Sequences||58.0%|Hard||
|1123|Lowest Common Ancestor of Deepest Leaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1123.Lowest-Common-Ancestor-of-Deepest-Leaves)|67.9%|Medium||
@@ -1271,7 +1271,7 @@
|1131|Maximum of Absolute Value Expression||52.1%|Medium||
|1132|Reported Posts II||34.6%|Medium||
|1133|Largest Unique Number||67.2%|Easy||
|1134|Armstrong Number||78.3%|Easy||
|1134|Armstrong Number||78.2%|Easy||
|1135|Connecting Cities With Minimum Cost||59.3%|Medium||
|1464|Maximum Product of Two Elements in an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1464.Maximum-Product-of-Two-Elements-in-an-Array)|77.2%|Easy||
|1465|Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts||32.5%|Medium||
@@ -1636,7 +1636,7 @@
|1496|Path Crossing||55.3%|Easy||
|1497|Check If Array Pairs Are Divisible by k||40.5%|Medium||
|1498|Number of Subsequences That Satisfy the Given Sum Condition||38.3%|Medium||
|1499|Max Value of Equation||45.3%|Hard||
|1499|Max Value of Equation||45.2%|Hard||
|1500|Design a File Sharing System||46.6%|Medium||
|1501|Countries You Can Safely Invest In||60.3%|Medium||
|1502|Can Make Arithmetic Progression From Sequence||71.2%|Easy||
@@ -1678,7 +1678,7 @@
|1538|Guess the Majority in a Hidden Array||61.6%|Medium||
|1642|Furthest Building You Can Reach||50.6%|Medium||
|1643|Kth Smallest Instructions||43.3%|Hard||
|1644|Lowest Common Ancestor of a Binary Tree II||57.3%|Medium||
|1644|Lowest Common Ancestor of a Binary Tree II||57.2%|Medium||
|1645|Hopper Company Queries II||40.0%|Hard||
|1646|Get Maximum in Generated Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1646.Get-Maximum-in-Generated-Array)|53.5%|Easy||
|1647|Minimum Deletions to Make Character Frequencies Unique|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1647.Minimum-Deletions-to-Make-Character-Frequencies-Unique)|54.3%|Medium||
@@ -1852,7 +1852,7 @@
|1712|Ways to Split Array Into Three Subarrays||29.8%|Medium||
|1713|Minimum Operations to Make a Subsequence||45.6%|Hard||
|1714|Sum Of Special Evenly-Spaced Elements In Array||48.2%|Hard||
|1715|Count Apples and Oranges||79.5%|Medium||
|1715|Count Apples and Oranges||79.4%|Medium||
|1716|Calculate Money in Leetcode Bank||67.6%|Easy||
|1717|Maximum Score From Removing Substrings||39.6%|Medium||
|1718|Construct the Lexicographically Largest Valid Sequence||44.3%|Medium||
@@ -1860,11 +1860,11 @@
|1720|Decode XORed Array||85.9%|Easy||
|1721|Swapping Nodes in a Linked List||65.0%|Medium||
|1722|Minimize Hamming Distance After Swap Operations||55.4%|Medium||
|1723|Find Minimum Time to Finish All Jobs||44.4%|Hard||
|1723|Find Minimum Time to Finish All Jobs||44.3%|Hard||
|1724|Checking Existence of Edge Length Limited Paths II||58.5%|Hard||
|1725|Number Of Rectangles That Can Form The Largest Square||77.7%|Easy||
|1726|Tuple with Same Product||55.1%|Medium||
|1727|Largest Submatrix With Rearrangements||58.2%|Medium||
|1727|Largest Submatrix With Rearrangements||58.3%|Medium||
|1728|Cat and Mouse II||40.9%|Hard||
|1729|Find Followers Count||72.2%|Easy||
|1730|Shortest Path to Get Food||59.4%|Medium||
@@ -1872,7 +1872,7 @@
|1732|Find the Highest Altitude||82.0%|Easy||
|1733|Minimum Number of People to Teach||36.4%|Medium||
|1734|Decode XORed Permutation||50.7%|Medium||
|1735|Count Ways to Make Array With Product||49.4%|Hard||
|1735|Count Ways to Make Array With Product||49.3%|Hard||
|1736|Latest Time by Replacing Hidden Digits||41.3%|Easy||
|1737|Change Minimum Characters to Satisfy One of Three Conditions||28.9%|Medium||
|1738|Find Kth Largest XOR Coordinate Value||62.1%|Medium||
@@ -1882,17 +1882,17 @@
|1742|Maximum Number of Balls in a Box||74.9%|Easy||
|1743|Restore the Array From Adjacent Pairs||61.9%|Medium||
|1744|Can You Eat Your Favorite Candy on Your Favorite Day?||30.3%|Medium||
|1745|Palindrome Partitioning IV||48.7%|Hard||
|1746|Maximum Subarray Sum After One Operation||64.0%|Medium||
|1745|Palindrome Partitioning IV||48.8%|Hard||
|1746|Maximum Subarray Sum After One Operation||64.1%|Medium||
|1747|Leetflex Banned Accounts||69.5%|Medium||
|1748|Sum of Unique Elements||77.9%|Easy||
|1749|Maximum Absolute Sum of Any Subarray||45.3%|Medium||
|1748|Sum of Unique Elements||78.0%|Easy||
|1749|Maximum Absolute Sum of Any Subarray||45.5%|Medium||
|1750|Minimum Length of String After Deleting Similar Ends||39.3%|Medium||
|1751|Maximum Number of Events That Can Be Attended II||42.0%|Hard||
|1751|Maximum Number of Events That Can Be Attended II||42.1%|Hard||
|1752|Check if Array Is Sorted and Rotated||48.6%|Easy||
|1753|Maximum Score From Removing Stones||57.3%|Medium||
|1754|Largest Merge Of Two Strings||32.2%|Medium||
|1755|Closest Subsequence Sum||23.1%|Hard||
|1753|Maximum Score From Removing Stones||57.5%|Medium||
|1754|Largest Merge Of Two Strings||32.4%|Medium||
Given an array consisting of`n`integers, find the contiguous subarray of given length`k`that has the maximum average value. And you need to output the maximum average value.
**Example 1:**
```
Input: [1,12,-5,-6,50,3], k = 4
Output: 12.75
Explanation: Maximum average is (12-5-6+50)/4 = 51/4 = 12.75
```
**Note:**
1. 1 <=`k`<=`n`<= 30,000.
2. Elements of the given array will be in the range [-10,000, 10,000].
## 题目大意
给定 n 个整数,找出平均数最大且长度为 k 的连续子数组,并输出该最大平均数。
## 解题思路
- 简单题。循环一次,扫描数组过程中累加窗口大小为 k 的元素值。不断更新这个最大值。循环结束求出平均值即可。
Given an array consisting of`n`integers, find the contiguous subarray of given length`k`that has the maximum average value. And you need to output the maximum average value.
**Example 1:**
```
Input: [1,12,-5,-6,50,3], k = 4
Output: 12.75
Explanation: Maximum average is (12-5-6+50)/4 = 51/4 = 12.75
```
**Note:**
1. 1 <=`k`<=`n`<= 30,000.
2. Elements of the given array will be in the range [-10,000, 10,000].
## 题目大意
给定 n 个整数,找出平均数最大且长度为 k 的连续子数组,并输出该最大平均数。
## 解题思路
- 简单题。循环一次,扫描数组过程中累加窗口大小为 k 的元素值。不断更新这个最大值。循环结束求出平均值即可。
|1317|Convert Integer to the Sum of Two No-Zero Integers|[Go]({{< relref "/ChapterFour/1300~1399/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers.md" >}})|Easy||||56.8%|
|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.8%|
|1680|Concatenation of Consecutive Binary Numbers|[Go]({{< relref "/ChapterFour/1600~1699/1680.Concatenation-of-Consecutive-Binary-Numbers.md" >}})|Medium||||52.4%|
|1685|Sum of Absolute Differences in a Sorted Array|[Go]({{< relref "/ChapterFour/1600~1699/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array.md" >}})|Medium||||61.8%|
|1329|Sort the Matrix Diagonally|[Go]({{< relref "/ChapterFour/1300~1399/1329.Sort-the-Matrix-Diagonally.md" >}})|Medium||||81.8%|
|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1600~1699/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||60.2%|
|1647|Minimum Deletions to Make Character Frequencies Unique|[Go]({{< relref "/ChapterFour/1600~1699/1647.Minimum-Deletions-to-Make-Character-Frequencies-Unique.md" >}})|Medium||||54.3%|
|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0500~0599/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||62.4%|
|0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0500~0599/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||62.1%|
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.