Write a program that print out an array that contains exactl
Write a program that print out an array that contains exactly the same numbers as the given array, but rearranged so that every 3 is immediately followed by a 4 and a 5. Do not move the 3\'s, but every other number may move. The array contains the same number of 3\'s, 4\'s and 5’s, every 3 has a number after it that is not a 3 or 4, and a 3 appears in the array before any 4. (create your own input to check the result) Thank you ! program need to write in C
Solution
public int[] fix34(int...nums) { int[] returnArray = new int[nums.length]; //ASSIGN ARRAY //We know that all 3\'s can\'t be moved, and after every 3 there //will automatically be a 4 for(int i = 0; i