15,966,952 members
See more:
```# totalIndexSeq = ['0+234+6+', '++++++', '012++5678']
```

```def longestSeqFinder(totalIndexSeq):
positionCounter = 0
positionChecker = 0
tryList = []
longestSeqList = []

for y in totalIndexSeq:

temp = y.split("+")
tryList.append(temp)

for i in tryList:
longestSeq = (max(i, key = len))
longestSeqList.append(longestSeq)```

What I have tried:

I am new to coding, and I'm honestly not sure where to begin.
Posted
Updated 22-Apr-19 11:38am
CPallini 20-Apr-19 15:21pm
I see no use for recursion in such a function. I mean iteration is fine there.
Richard MacCutchan 21-Apr-19 4:53am
Since you are new I would suggest you forget about recursion until you have more experience, and can understand when it may be useful. In the above case recursion is unlikely to help you.

## Solution 1

Recursion means the function calls itself. If your function calls itself, it's using recursion. An obvious use for recursion would be to navigate a tree, the method always goes through the children of a node, and calls itself. When the tree ends, the recursion ends.

I've had interview questions that ask me to write a recursive function where it makes no sense. Recursion is not a complex thing, there's tons of tutorials and examples. If you want to learn recursion, I'd suggest the starting point is using an example where it makes sense to use it