1 package Today; 2 //LeetCode:453. Minimum Moves to Equal Array Elements 3 /* 4 Given a non-empty integer array of size n, find the minimum number of moves required to make all array 5 elements equal, where a move is incrementing n - 1 elements by 1. 6 7 Example: 8 Input: 9 [1,2,3]10 Output:11 312 Explanation:13 Only three moves are needed (remember each move increments two elements):14 [1,2,3] => [2,3,3] => [3,4,3] => [4,4,4]15 */16 public class minMoves453 {17 public static int minMoves(int[] nums) {18 int min=nums[0];19 int sum=0;20 for(int i=1;i