I've included 'from math import log' and am getting an error with 'math domain error' .. any suggestions?
You can't import anything. Just assume what you need is already there, but if it's not, sorry no one can help you.
Try this on a Python interpreter.
>> print math.log(10)
>> print math.log(0)
Line 5: ValueError: math domain error
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.