[LeetCode] Sum of Decoded Numbers

4039. Sum of Decoded Numbers

You are given an integer array nums.

Each nums[i] is an encoded integer representing two positive integers x_i and y_i. To decode nums[i], define:

  • width_i = nums[i] % 10.
  • d_i = floor(nums[i] / 10).
  • x_i as the integer formed by the first width_i digits of the decimal representation of d_i.
  • y_i as the integer formed by all remaining digits of the decimal representation of d_i.

It is guaranteed that the decimal representation of d_i contains more than width_i digits. Therefore, both x_i and y_i contain at least one digit.

The decoded value of nums[i] is x_i^y_i.

Return the sum of the decoded values of all elements in nums, modulo 10^9 + 7.

The floor() function returns the integer part of the division.

Read more
[LeetCode] Count Integers Appearing in a Single Block

4038. Count Integers Appearing in a Single Block

You are given an integer array nums.

An integer x is special if all occurrences of x in nums appear in a single contiguous block.

Return the number of distinct special integers in nums.

Read more
[AtCoder] F - Max ComboRead more
[AtCoder] E - Count A%B=CRead more
[AtCoder] E - Reverse 2^iRead more
[AtCoder] E - LCM SequenceRead more
[AtCoder] E - E [max]Read more
[AtCoder] B - LCMRead more
[AtCoder] F - Connecting PointsRead more
[AtCoder] E - Minimum OR PathRead more