Hi guys,
any idea to optimise this code as the performance is very very bad....
from: https://en.wikipedia.org/wiki/Look-and-say_sequence
any idea to optimise this code as the performance is very very bad....
B4X:
Dim num As String = "1"
For a=1 To 50
count =a
Log(num)
num= Conway(num)
Next
Sub Conway(number As String)As String
res =""
Dim repeat As String = number.CharAt(0)
number = sf.mid(number,1+1,number.Length-1)&" "
Dim a() As Char = bc.ToChars(number)
Dim times As Int = 1
For Each actual As String In a
If actual <> repeat Then
res=res×&repeat
times=1
repeat=actual
Else
times = times +1
End If
Next
Return res
End Sub
from: https://en.wikipedia.org/wiki/Look-and-say_sequence