Geeksforgeeks · Technology · 2026-08-16
Find the Minimum Operations to Equalize Array
Given an integer array arr[], find the minimum number of operations required to make all its elements equal. In one operation, choose two indices i and j such that arr[i] > arr[j], decrease arr[i] by 1, and increase arr[j] by 1. Return -1 if it is impossible to make all array elements equal.Examples : Input: arr[] = [1,
Read original on Geeksforgeeks Get the app
Licensed summary · LicensedSummary
Related briefs
- HMD 2760 Flip design and key specs leak, said to run Android 13 Go
- Samsung Announces Partnership With Call of Duty®: Modern Warfare® 4
- CUBOT Teases KINGKONG Dura, a Rugged Phone Built Around Swappable Battery Power
- I’m hooked on Peak Design’s new City bags
- iPhone 18 Pro Max vs Pixel 11 Pro XL: Which Flagship Could Be Better for You?