Skip to content

Practice Minimum Cost to Make Array Equalindromic

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#2967
LeetCode Problem

Minimum Cost to Make Array Equalindromic

Problem Statement

One operation increases or decreases one nums entry by 1. Return the fewest operations needed to make all entries equal to the same positive palindromic integer, whose decimal digits read the same in either direction.

Source: Minimum Cost to Make Array Equalindromic on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [1,2,3,4,5]
Output
6

# Example 2

Input
nums = [10,12,13,14,15]
Output
11

# Example 3

Input
nums = [22,33,22,33,22]
Output
22

Constraints

1 <= n <= 10^5
1 <= nums[i] <= 10^9

Related LeetCode Problems

Practice more problems similar to Minimum Cost to Make Array Equalindromic.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.