[LeetCode] Number of Strings Which Can Be Rearranged to Contain Substring

2931. Maximum Spending After Buying Items

You are given an integer n.

A string s is called good if it contains only lowercase English characters and it is possible to rearrange the characters of s such that the new string contains "leet" as a substring.

For example:

  • The string "lteer" is good because we can rearrange it to form "leetr" .
  • "letl" is not good because we cannot rearrange it to contain "leet" as a substring.

Return the total number of good strings of length n.

Since the answer may be large, return it modulo 109 + 7.

A substring is a contiguous sequence of characters within a string.

Read more
[LeetCode] Distribute Candies Among Children II

2929. Distribute Candies Among Children II

You are given two positive integers n and limit.

Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies.

Read more
[LeetCode] Distribute Candies Among Children I

2928. Distribute Candies Among Children I

You are given two positive integers n and limit.

Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies.

Read more
[AtCoder] D - Grid Ice FloorRead more
[AtCoder] B - Switching TravelRead more
[AtCoder] C - Reversible Card GameRead more
[AtCoder] E - Family and InsuranceRead more
[AtCoder] B - Favorite Game Read more
[Hacker Earth] Intersection of intervalsRead more
[Hacker Earth] Largest SquareRead more