Last one I'm doing.
NIM
proc reverse*(str: string): string =
result = ""
for index in countdown(str.high, 0):
result.add(str[index])
type
milarray = array[1000001, int]
var
s = ""
t = ""
r:string
a:milarray
for x in 0..1000000:
a[x] = x
s &= chr((x mod 26) + 65)
if s.len == 26:
t &= s
s = ""
r = t.reverse
echo "r Len: ",r.len
echo "Front: ",r[0..25]
echo "Back: ",r[r.len-26..r.len-1]
echo "UBVal: ",a[1000000]
On my RPI 3B+:
riveraa@dpi:~ $ time ./mil
r Len: 999986
Front: ZYXWVUTSRQPONMLKJIHGFEDCBA
Back: ZYXWVUTSRQPONMLKJIHGFEDCBA
UBVal: 1000000
real 0m0.123s
user 0m0.104s
sys 0m0.019s
AIR.