We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
C#codeclassSolution{publicstaticvoidMain(string[]args){intn=Convert.ToInt32(Console.ReadLine());varrec=Console.ReadLine();if(rec!=null){List<int>arr=rec.TrimEnd().Split(' ').Reverse().ToList().Select(arrTemp=>Convert.ToInt32(arrTemp)).ToList();//if you dont want to use foreach can use string.join ( string outPut = String.Join(" ", arr); )foreach(vardatainarr){Console.Write(data+" ");}}}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 7: Arrays
You are viewing a single comment's thread. Return to all comments →