+ 2
Write a method to find first not repeated digit of a given interger number by c#
example we have (679683978) we need to print 3 is non repeated
2 Respuestas
+ 2
thank you so much #Md.Almajed
+ 1
Please check the following code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
int numValue = 679683978;
int[] numArray = numValue.ToString().Select(o => Convert.ToInt32(o.ToString())).ToArray();
foreach(int num in numArray){
if(numArray.Where(o => o == num).Count() == 1){
Console.WriteLine(num);
break;
}
}
}
}
}
You can check the output here: https://code.sololearn.com/cPaXeaMf2oHi