I have written this function to get the size of a string, can it be optimized?
I don’t want to use python functions to calculate but I want to implement a function myself. The problem comes when the chain is very long. The program starts to take about 5 minutes.