Refactor ProblemOne to remove a variable

Signed-off-by: Rohan Mathur <rohanmathur34@gmail.com>