You don't consider the flowchart in post #26 to be "paper and pencil"?can someone show me how do you solve the problem with paper and pencil?
The algorithm isn't complicated. You can determine the results by passing through the array of numbers once. I don't know why sorting is being mentioned. I don't think it's necessary.
