Given a string, find the length of the longest substring without repeating characters.
Example 1:
Input: "abcabcbb" Output: 3 Explanation: The answer is "abc"
, with the length of 3.
Continue reading “[Leetcode]3. Longest Substring Without Repeating Characters” [Leetcode]1508. Range Sum of Sorted Subarray Sums
Given the arrayContinue reading “[Leetcode]1508. Range Sum of Sorted Subarray Sums”nums
consisting ofn
positive integers. You computed the sum of all non-empty continous subarrays from the array and then sort them in non-decreasing order, creating a new array ofn * (n + 1) / 2
numbers. Return the sum of the numbers from indexleft
to indexright
(indexed from 1), inclusive, in the new array. Since the answer can be a huge number return it modulo 10^9 + 7.