0

the program has to accept an integer and in the output, yes to be displayed if the integer uses 3 unique numbers, else no

Example Input/Output 1: Input: 1221255 Output: yes Example Input/Output 2: Input: 1024 Output: no

20th Apr 2020, 8:00 AM
sai kumar
sai kumar - avatar
2 ответов
+ 3
Hint: * Transform the number into string * Make a set object out of the string * Check how many elements contained in the set * If it counts to three elements exactly, print "yes" otherwise "no" You can do this, give it a try! 👍
20th Apr 2020, 9:51 AM
Ipang
+ 1
Ok,I am trying thanks a lot for the suggestion
20th Apr 2020, 1:20 PM
sai kumar
sai kumar - avatar