Posts

Showing posts from July, 2024

Find duplicate entry in array | Simple way

 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApp1 {     internal class Program     {         static void Main(string[] args)         {             int[] inputArr =new int[] { 1, 2, 3,4,1,4 };             int[] outputArr = new int[inputArr.Length];             for (int i = 0; i < inputArr.Length; i++)             {                 Array.Sort(inputArr);                 if(i != 0)                 {                     if (outputArr[i-1] != inputArr[i])                     {                 ...

Convert "reverse_me_hello" string to reverseMeHello

 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApp1 {     internal class Program     {         static void Main(string[] args)         {             string dummSytring = "reverse_me_hello";             Console.WriteLine(dummSytring);                           //Array.Reverse(stringArr);             string[] RevStringArr = dummSytring.Split('_');                          StringBuilder stringBuilder = new StringBuilder();             for (int j = 0; j < RevStringArr.Length; j++)             {                 string abc = RevStringArr[j];     ...