C
C
CallMeYourDaddy2020-07-07 17:44:42
C++ / C#
CallMeYourDaddy, 2020-07-07 17:44:42

How to find the same digits in numbers?

I have numbers: 23 and 11 (the numbers are different and should return true), 45 and 94 (one of the numbers is the same, should return false). how to do it?

I only managed to do with linq:

Console.WriteLine(a.ToString().All(_=> !b.ToString().Contains(_)));

Answer the question

In order to leave comments, you need to log in

1 answer(s)
#
#, 2020-07-07
@CallMeYourDaddy

https://dotnetfiddle.net/tAobxz
ps but of course it's better like this
https://dotnetfiddle.net/7pgNVE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question