Documentation ¶
Overview ¶
739. Daily Temperatures Medium Topics Companies Hint Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead.
Example 1:
Input: temperatures = [73,74,75,71,69,72,76,73] Output: [1,1,4,2,1,1,0,0] Example 2:
Input: temperatures = [30,40,50,60] Output: [1,1,1,0] Example 3:
Input: temperatures = [30,60,90] Output: [1,1,0]
Constraints:
1 <= temperatures.length <= 105 30 <= temperatures[i] <= 100
907. Sum of Subarray Minimums Medium Topics Companies Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be large, return the answer modulo 109 + 7.
Example 1:
Input: arr = [3,1,2,4] Output: 17 Explanation: Subarrays are [3], [1], [2], [4], [3,1], [1,2], [2,4], [3,1,2], [1,2,4], [3,1,2,4]. Minimums are 3, 1, 2, 4, 1, 1, 2, 1, 1, 1. Sum is 17. Example 2:
Input: arr = [11,81,94,43,3] Output: 444
Constraints:
1 <= arr.length <= 3 * 104 1 <= arr[i] <= 3 * 104
Source Files ¶
- add-binary.go
- binary-tree-inorder-traversal.go
- climbing-stairs.go
- count-nice-pairs-in-an-array.go
- daily-temperatures.go
- find-first-palindromic-string-in-the-array.go
- find-polygon-with-the-largest-perimeter.go
- find-the-index-of-the-first-occurrence-in-a-string.go
- find-unique-binary-string.go
- first-letter-to-appear-twice.go
- first-unique-character-in-a-string.go
- implement-queue-using-stacks.go
- least-number-of-unique-integers-after-k-removals.go
- length-of-last-word.go
- longest-common-prefix.go
- loops.go
- maximum-depth-of-binary-tree.go
- maximum-length-of-a-concatenated-string-with-unique-characters.go
- merge-sorted-array.go
- merge-two-sorted-lists.go
- minimize-maximum-pair-sum-in-array.go
- minimum-falling-path-sum.go
- missing-number.go
- number-of-1-bits.go
- number-of-islands.go
- palindrome-linked-list.go
- palindrome-number.go
- plus-one.go
- power-of-four.go
- power-of-three.go
- ransom-note.go
- rearrange-array-elements-by-sign.go
- remove-duplicates-from-sorted-array.go
- remove-duplicates-from-sorted-list.go
- remove-element.go
- reverse-linked-list.go
- roman-to-integer.go
- rotate-image.go
- same-tree.go
- search-insert-position.go
- set-mismatch.go
- sqrtx.go
- sum-of-subarray-minimums.go
- symmetric-tree.go
- two-sum.go
- unique-number-of-occurrences.go
- valid-parentheses.go