I've read a nice post/article by maha anna about these kinds of problems, but I can't seem to find the link. Basically, keep track of k's value and just work your way from left to right:
- when you come across a
prefix operator, add 1 to k's current value, then use this value.
- when you come across a
postfix operator, use k's current value in this instance, then increment the current value by 1.
Ok, so that wasn't a very good explanation...

Let's use your example:
So using the returned values, 2 + 2 + 3 = 7.
Hope this makes it clear, if not, I hope someone can find the original post/article.
