SoFunction
Updated on 2025-03-06

Move the specified number of elements in the array to the implementation code behind the array


        static void Main()
        {
            int[] array = { 1, 2, 3, 4, 5, 6, 7 };
            MoveNumberArrayToEnd(array, 3);
        }
        static void MoveNumberArrayToEnd<T>(IList<T> arrayList, int num)
        {
            if ( < = 0 || < num)
            {
                throw new RankException();
            }
            var query = (from number in arrayList
                         orderby number descending
                         select number).Take( - num).Concat((num));
            ().ForEach(q => ("{0}", q));
        }