{"comment":{"url":"https://api.github.com/repos/jyothsnakasu/Assignment2-/comments/9365123","html_url":"https://github.com/jyothsnakasu/Assignment2-/commit/3fe5580d819f9401e15ee35cf2b24b513c5e18e4#commitcomment-9365123","id":9365123,"user":{"login":"jyothsnakasu","id":8209829,"avatar_url":"https://avatars.githubusercontent.com/u/8209829?v=3","gravatar_id":"","url":"https://api.github.com/users/jyothsnakasu","html_url":"https://github.com/jyothsnakasu","followers_url":"https://api.github.com/users/jyothsnakasu/followers","following_url":"https://api.github.com/users/jyothsnakasu/following{/other_user}","gists_url":"https://api.github.com/users/jyothsnakasu/gists{/gist_id}","starred_url":"https://api.github.com/users/jyothsnakasu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyothsnakasu/subscriptions","organizations_url":"https://api.github.com/users/jyothsnakasu/orgs","repos_url":"https://api.github.com/users/jyothsnakasu/repos","events_url":"https://api.github.com/users/jyothsnakasu/events{/privacy}","received_events_url":"https://api.github.com/users/jyothsnakasu/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"3fe5580d819f9401e15ee35cf2b24b513c5e18e4","created_at":"2015-01-20T22:23:02Z","updated_at":"2015-01-20T22:23:02Z","body":"makeCacheMatrix <- function(x = matrix()) {\r\n  inv <- NULL\r\n  set <- function(y) {\r\n    x <<- y\r\n    inv <<- NULL\r\n  }\r\n  get <- function() x\r\n  setinverse <- function(inverse) inv <<- inverse\r\n  getinverse <- function() inv\r\n  list(set=set, get=get, setinverse=setinverse, getinverse=getinverse)\r\n}\r\n\r\n\r\ncacheSolve <- function(x, ...) {\r\n  inv <- x$getinverse()\r\n  if(!is.null(inv)) {\r\n    message(\"getting cached data.\")\r\n    return(inv)\r\n  }\r\n  data <- x$get()\r\n  inv <- solve(data)\r\n  x$setinverse(inv)\r\n  inv\r\n}"}}