algorithm questions, solutions for #1 & #2