[AtCoder] D - FT RobotRead more
[AtCoder] C - Good SequenceRead more
[AtCoder] B - Two AnagramsRead more
[Codeforces] Beta Round #30 (Codeforces format) A. AccountingRead more
[Codeforces] School Personal Contest #1 (Winter Computer School 2010/11) - Codeforces Beta Round #38 (ACM-ICPC Rules) C. BlindsRead more
[Codeforces] Beta Round #40 (Div. 2) B. Martian DollarRead more
[Codeforces] Beta Round #41 A. Guilty — to the kitchen!Read more
[Codeforces] School Team Contest #2 (Winter Computer School 2010/11) E. Anfisa the MonkeyRead more
[LeetCode] Vowels of All Substrings

2063. Vowels of All Substrings

Given a string word, return the sum of the number of vowels (‘a’, ‘e’, ‘i’, ‘o’, and ‘u’) in every substring of word.

A substring is a contiguous (non-empty) sequence of characters within a string.

Note: Due to the large constraints, the answer may not fit in a signed 32-bit integer. Please be careful during the calculations.

Read more
[LeetCode] Minimized Maximum of Products Distributed to Any Store

2064. Minimized Maximum of Products Distributed to Any Store

You are given an integer n indicating there are n specialty retail stores. There are m product types of varying amounts, which are given as a 0-indexed integer array quantities, where quantities[i] represents the number of products of the ith product type.

You need to distribute all products to the retail stores following these rules:

  • A store can only be given at most one product type but can be given any amount of it.
  • After distribution, each store will have been given some number of products (possibly 0). Let x represent the maximum number of products given to any store. You want x to be as small as possible, i.e., you want to minimize the maximum number of products that are given to any store.

Return the minimum possible x.

Read more