/
ch-1.rb
43 lines (32 loc) · 912 Bytes
/
ch-1.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env ruby
=begin comment
-------------------------------------
AUTHOR: Robert DiCicco
DATE : 2023-10-16
Challenge 239 Task 01 Same String ( Ruby )
------------------------------------
=end comment
myarr1 = [["ab", "c"],["ab", "c"],["ab", "cd", "e"]]
myarr2 = [["a", "bc"],["ac", "b"],["abcde"]]
cnt = 0
while cnt < myarr1.length()
puts("Input: @arr1 = [#{myarr1[cnt]}]")
puts("\t@arr2 = [#{myarr2[cnt]}]")
myarr1[cnt].join == myarr2[cnt].join ? puts("Output: true\n\n") : puts("Output: false\n\n")
cnt += 1
end
=begin comment
-------------------------------------
SAMPLE OUTPUT
ruby .\SameString.rb
Input: @arr1 = [["ab", "c"]]
@arr2 = [["a", "bc"]]
Output: true
Input: @arr1 = [["ab", "c"]]
@arr2 = [["ac", "b"]]
Output: false
Input: @arr1 = [["ab", "cd", "e"]]
@arr2 = [["abcde"]]
Output: true
------------------------------------
=end comment