Given a string, find the length of the longest substring without repeating characters.
Input: "abcabcbb" Output: 3 Explanation: The answer is
Continue reading “[Leetcode]3. Longest Substring Without Repeating Characters”
"abc", with the length of 3.
Given the array
Continue reading “[Leetcode]1508. Range Sum of Sorted Subarray Sums”
nums consisting of
n 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 of
n * (n + 1) / 2 numbers.
Return the sum of the numbers from index
left to index
right (indexed from 1), inclusive, in the new array. Since the answer can be a huge number return it modulo 10^9 + 7.