aboutsummaryrefslogtreecommitdiff
path: root/challenge-195/robert-dicicco/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-195/robert-dicicco/python/ch-1.py')
-rw-r--r--challenge-195/robert-dicicco/python/ch-1.py63
1 files changed, 63 insertions, 0 deletions
diff --git a/challenge-195/robert-dicicco/python/ch-1.py b/challenge-195/robert-dicicco/python/ch-1.py
new file mode 100644
index 0000000000..1a1678775e
--- /dev/null
+++ b/challenge-195/robert-dicicco/python/ch-1.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+
+'''
+
+AUTHOR: Robert DiCicco
+
+DATE : 2022-12-13
+
+Challenge 195 Special Integers ( Python )
+
+
+SAMPLE OUTPUT
+
+python .\SpecialIntegers.py
+
+Input: $n = 15
+
+Output: 14
+
+
+Input: $n = 35
+
+Output: 32
+
+-------------------------------------------------
+
+'''
+
+
+def CheckUniqueDigits(n) :
+
+ seen = {}
+
+ my_list = [int(x) for x in str(n)]
+
+ for onedig in my_list:
+
+ if onedig in seen:
+
+ return 0
+
+ else :
+
+ seen[onedig] = 1
+
+ return 1
+
+
+for n in [15, 35] :
+
+ output = 0
+
+ print("Input: $n = ", n)
+
+ for x in range(0,n):
+
+ output += CheckUniqueDigits(x)
+
+ print(f"Output: {output}\n")