Added cacheSolve function implementation

Added implementation and detail comments on each line.