A gunman opened fire inside a Brown University academic building Saturday afternoon as students were gathered to take their final exams, killing two students and injuring nine others.