Let X and Y be locally compact Hausdorff spaces, where X is first-countable. Fix a positive integer n ⩾ 3 and a non-zero complex number λ. If a surjective map T : C0(X) → C0(Y ) satisfies the condition supy|Πnk+1T(fk)(y) + λ|= supϰ∊X|(Πnk=1 fk)(x) + λ| for all fk ∊ C0(X) (k = 1, . . . , n), then there exist a homeomorphism ϕ: Y → X, a continuous function w: Y → 핋, and a clopen set K ⊂ Y such that T(f) = w ⨰ (f ◦ ϕ) on K and T(f) = w ⨰ (f ◦ ϕ) on Y \ K for all f ∊ C0(X). Let A, B be function algebras on X, Y . Fix a positive integer n ⩾ 2. Suppose that X = Ch(A) and Y = Ch(B). If a surjective map T : A → B satisfies the condition σ л Πnk=1 T(fk)) ∩ σл(Πnk=1 fk)≠ø for all fk ∊ A (k = 1, . . . , n), then T is a weighted composition operator. [ABSTRACT FROM AUTHOR]