谷歌冬季实习店面

第一问
https://leetcode.com/problems/subarray-sum-equals-k 变种

第二问

One string is strictly smaller than another when the frequency of occurrence of the smallest character in the string is less than the frequency of occurrence of the smallest character in the comparison string.

For example, string “abcd” is smaller than string “aaa” because the smallest character in “abcd” is ‘a’, with a frequency of 1. The smallest character in “aaa” is also ‘a’, but with a frequency of 3. In another example, string “a” is smaller than string “bb” because the smallest character in “a” is ‘a’ with a frequency of 1, and the smallest character in “bb” is ‘b’ with a frequency of 2.

Write a function that, given string A and string B, returns an array C of integers. The number of strings in A which are strictly smaller than the comparison string in B.

Given strings A and B such that:
A = “abcd aabc bd”
B = “aaa aa”

the function should return [3, 2].