followed arjun's solution for 10