Added another approach (pseudocode)