aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2022-08-31 23:53:54 +0100
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2022-08-31 23:53:54 +0100
commitb8779c9524ce3bf81171d495fda837d9d0b04e97 (patch)
treef5d87250fcd50ecaff673c470884bf6141cdbfec
parent4d856a5504960441b15eb0a26942e135856b4355 (diff)
downloadperlweeklychallenge-club-b8779c9524ce3bf81171d495fda837d9d0b04e97.tar.gz
perlweeklychallenge-club-b8779c9524ce3bf81171d495fda837d9d0b04e97.tar.bz2
perlweeklychallenge-club-b8779c9524ce3bf81171d495fda837d9d0b04e97.zip
- Added more guest contribution by Robert DiCicco.
-rw-r--r--challenge-180/robert-dicicco/julia/ch-1.jl63
1 files changed, 63 insertions, 0 deletions
diff --git a/challenge-180/robert-dicicco/julia/ch-1.jl b/challenge-180/robert-dicicco/julia/ch-1.jl
new file mode 100644
index 0000000000..9c34276c31
--- /dev/null
+++ b/challenge-180/robert-dicicco/julia/ch-1.jl
@@ -0,0 +1,63 @@
+#!julia.exe
+
+using DataStructures
+
+# AUTHOR: Robert DiCicco
+# DATE: 2022-08-31
+# Challenge #180 First Unique Character ( Julia )
+
+arr = ["Perl Weekly Challenge", "Long Live Perl" ]
+
+nums = [3,4]
+
+count = 1
+
+LetterCnt = OrderedDict()
+
+function mysetup( s )
+
+ Letters = split(s,"")
+
+ for ch in Letters
+
+ if haskey(LetterCnt, ch)
+
+ LetterCnt[ch] += 1
+
+ else
+
+ LetterCnt[ch] = 1
+
+ end
+
+ end
+
+ offset = 0
+
+ for ch in Letters
+
+ if LetterCnt[ch] == 1
+
+ println("Output: " * string(offset) * " as \'" * ch * "\' is the first unique character")
+
+ println(" ")
+
+ break
+
+ end
+
+ offset += 1
+
+ end
+
+end
+
+for str in arr
+
+ print("Input: \$s = \"" * str * "\"\n")
+
+ mysetup(str)
+
+ global count += 1
+
+end