Skip to content

Commit c4f225c

Browse files
author
chrislsavage
committed
complete
1 parent d3929f9 commit c4f225c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

OfflineMinimum.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
def OffLineMinimum(strArr)
2+
arr = []
3+
arr_sort = ""
4+
i = 0
5+
length = strArr.length - 1
6+
while i < strArr.length
7+
if strArr[i] == "E"
8+
9+
arr_sort += arr[0] + ","
10+
arr.delete_at(0)
11+
puts arr[0]
12+
13+
else
14+
arr.push(strArr[i])
15+
arr = arr.sort()
16+
end
17+
i+=1
18+
19+
end
20+
arr_sort = arr_sort.split("")
21+
arr_sort.pop()
22+
arr_sort = arr_sort.join("")
23+
return arr_sort
24+
25+
end

0 commit comments

Comments
 (0)