payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/comments/277149728","pull_request_review_id":228894474,"id":277149728,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI3NzE0OTcyOA==","diff_hunk":"@@ -1,61 +1,118 @@\n-require_relative 'restricted_array.rb'\n+require_relative \"restricted_array.rb\"\n # RestrictedArray can be created using a specified size, or a random size in\n # the range of 1-20 will be chosen for you.\n # All values are integers in the range of 1-221.\n # RestrictedArray cannot be resized.\n \n # Calculates the length of the restricted array. All values are integers.\n # The restricted_array is terminated by 'nil' i.e. array[length] = nil\n-# Time complexity: ?\n-# Space complexity: ?\n+# Time complexity: Linear or (O)n, where n is the number of items in\n+# the array or the length of the input array\n+# Space complexity: constant O(1)\n def length(array)\n-  raise NotImplementedError\n+  i = 0\n+  while array[i] != nil\n+    i += 1\n+  end\n+  return i\n end\n \n # Prints each integer values in the array\n-# Time complexity: ?\n-# Space complexity: ?\n+# Time complexity: linear O(n), where n is the lenght of the array\n+# Space complexity: constant O(1)\n+\n def print_array(array)\n-  raise NotImplementedError\n+  len = length(array)","path":"lib/using_restricted_array.rb","position":32,"original_position":32,"commit_id":"d7fa92398d5108f7440dadeaecf2550ecbb616dd","original_commit_id":"d7fa92398d5108f7440dadeaecf2550ecbb616dd","user":{"login":"mmcknett","id":2801510,"node_id":"MDQ6VXNlcjI4MDE1MTA=","avatar_url":"https://avatars2.githubusercontent.com/u/2801510?v=4","gravatar_id":"","url":"https://api.github.com/users/mmcknett","html_url":"https://github.com/mmcknett","followers_url":"https://api.github.com/users/mmcknett/followers","following_url":"https://api.github.com/users/mmcknett/following{/other_user}","gists_url":"https://api.github.com/users/mmcknett/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcknett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcknett/subscriptions","organizations_url":"https://api.github.com/users/mmcknett/orgs","repos_url":"https://api.github.com/users/mmcknett/repos","events_url":"https://api.github.com/users/mmcknett/events{/privacy}","received_events_url":"https://api.github.com/users/mmcknett/received_events","type":"User","site_admin":false},"body":"[nit] You can technically save yourself the additional time to run length(array) by using until array[i] == nil in this method the way you did for length. Normally, when using built-in arrays, I would prefer what you have here because it's fast to get the length of a normal array. In this case, though, not using length(array) would save actual time (though not big-O time).","created_at":"2019-04-21T00:12:16Z","updated_at":"2019-04-21T00:31:30Z","html_url":"https://github.com/Ada-C11/Restricted-Arrays-Part1/pull/26#discussion_r277149728","pull_request_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/26","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/comments/277149728"},"html":{"href":"https://github.com/Ada-C11/Restricted-Arrays-Part1/pull/26#discussion_r277149728"},"pull_request":{"href":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/26","id":262737325,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYyNzM3MzI1","html_url":"https://github.com/Ada-C11/Restricted-Arrays-Part1/pull/26","diff_url":"https://github.com/Ada-C11/Restricted-Arrays-Part1/pull/26.diff","patch_url":"https://github.com/Ada-C11/Restricted-Arrays-Part1/pull/26.patch","issue_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/issues/26","number":26,"state":"open","locked":false,"title":"Ports - Myriam","user":{"login":"MyriamWD","id":44131483,"node_id":"MDQ6VXNlcjQ0MTMxNDgz","avatar_url":"https://avatars2.githubusercontent.com/u/44131483?v=4","gravatar_id":"","url":"https://api.github.com/users/MyriamWD","html_url":"https://github.com/MyriamWD","followers_url":"https://api.github.com/users/MyriamWD/followers","following_url":"https://api.github.com/users/MyriamWD/following{/other_user}","gists_url":"https://api.github.com/users/MyriamWD/gists{/gist_id}","starred_url":"https://api.github.com/users/MyriamWD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MyriamWD/subscriptions","organizations_url":"https://api.github.com/users/MyriamWD/orgs","repos_url":"https://api.github.com/users/MyriamWD/repos","events_url":"https://api.github.com/users/MyriamWD/events{/privacy}","received_events_url":"https://api.github.com/users/MyriamWD/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-03-20T06:35:07Z","updated_at":"2019-04-21T00:31:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8541921c72008a45313d8ce71d56ebf1bda9a277","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/26/commits","review_comments_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/26/comments","review_comment_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/issues/26/comments","statuses_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/statuses/d7fa92398d5108f7440dadeaecf2550ecbb616dd","head":{"label":"MyriamWD:master","ref":"master","sha":"d7fa92398d5108f7440dadeaecf2550ecbb616dd","user":{"login":"MyriamWD","id":44131483,"node_id":"MDQ6VXNlcjQ0MTMxNDgz","avatar_url":"https://avatars2.githubusercontent.com/u/44131483?v=4","gravatar_id":"","url":"https://api.github.com/users/MyriamWD","html_url":"https://github.com/MyriamWD","followers_url":"https://api.github.com/users/MyriamWD/followers","following_url":"https://api.github.com/users/MyriamWD/following{/other_user}","gists_url":"https://api.github.com/users/MyriamWD/gists{/gist_id}","starred_url":"https://api.github.com/users/MyriamWD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MyriamWD/subscriptions","organizations_url":"https://api.github.com/users/MyriamWD/orgs","repos_url":"https://api.github.com/users/MyriamWD/repos","events_url":"https://api.github.com/users/MyriamWD/events{/privacy}","received_events_url":"https://api.github.com/users/MyriamWD/received_events","type":"User","site_admin":false},"repo":{"id":175671920,"node_id":"MDEwOlJlcG9zaXRvcnkxNzU2NzE5MjA=","name":"Restricted-Arrays-Part1","full_name":"MyriamWD/Restricted-Arrays-Part1","private":false,"owner":{"login":"MyriamWD","id":44131483,"node_id":"MDQ6VXNlcjQ0MTMxNDgz","avatar_url":"https://avatars2.githubusercontent.com/u/44131483?v=4","gravatar_id":"","url":"https://api.github.com/users/MyriamWD","html_url":"https://github.com/MyriamWD","followers_url":"https://api.github.com/users/MyriamWD/followers","following_url":"https://api.github.com/users/MyriamWD/following{/other_user}","gists_url":"https://api.github.com/users/MyriamWD/gists{/gist_id}","starred_url":"https://api.github.com/users/MyriamWD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MyriamWD/subscriptions","organizations_url":"https://api.github.com/users/MyriamWD/orgs","repos_url":"https://api.github.com/users/MyriamWD/repos","events_url":"https://api.github.com/users/MyriamWD/events{/privacy}","received_events_url":"https://api.github.com/users/MyriamWD/received_events","type":"User","site_admin":false},"html_url":"https://github.com/MyriamWD/Restricted-Arrays-Part1","description":"Assignment to work with array data structure or restricted arrays (as compared to Ruby Array class).","fork":true,"url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1","forks_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/forks","keys_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/teams","hooks_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/hooks","issue_events_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/issues/events{/number}","events_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/events","assignees_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/assignees{/user}","branches_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/branches{/branch}","tags_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/tags","blobs_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/git/refs{/sha}","trees_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/statuses/{sha}","languages_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/languages","stargazers_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/stargazers","contributors_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/contributors","subscribers_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/subscribers","subscription_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/subscription","commits_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/commits{/sha}","git_commits_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/git/commits{/sha}","comments_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/comments{/number}","issue_comment_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/issues/comments{/number}","contents_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/contents/{+path}","compare_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/merges","archive_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/downloads","issues_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/issues{/number}","pulls_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/pulls{/number}","milestones_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/milestones{/number}","notifications_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/labels{/name}","releases_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/releases{/id}","deployments_url":"https://api.github.com/repos/MyriamWD/Restricted-Arrays-Part1/deployments","created_at":"2019-03-14T17:46:14Z","updated_at":"2019-03-20T06:34:13Z","pushed_at":"2019-03-20T06:34:11Z","git_url":"git://github.com/MyriamWD/Restricted-Arrays-Part1.git","ssh_url":"git@github.com:MyriamWD/Restricted-Arrays-Part1.git","clone_url":"https://github.com/MyriamWD/Restricted-Arrays-Part1.git","svn_url":"https://github.com/MyriamWD/Restricted-Arrays-Part1","homepage":"","size":9,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Ada-C11:master","ref":"master","sha":"4b4909cc0704baaaaf0de3b2483cf9656908eb10","user":{"login":"Ada-C11","id":46505161,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2NTA1MTYx","avatar_url":"https://avatars1.githubusercontent.com/u/46505161?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C11","html_url":"https://github.com/Ada-C11","followers_url":"https://api.github.com/users/Ada-C11/followers","following_url":"https://api.github.com/users/Ada-C11/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C11/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C11/subscriptions","organizations_url":"https://api.github.com/users/Ada-C11/orgs","repos_url":"https://api.github.com/users/Ada-C11/repos","events_url":"https://api.github.com/users/Ada-C11/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C11/received_events","type":"Organization","site_admin":false},"repo":{"id":168250429,"node_id":"MDEwOlJlcG9zaXRvcnkxNjgyNTA0Mjk=","name":"Restricted-Arrays-Part1","full_name":"Ada-C11/Restricted-Arrays-Part1","private":false,"owner":{"login":"Ada-C11","id":46505161,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2NTA1MTYx","avatar_url":"https://avatars1.githubusercontent.com/u/46505161?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C11","html_url":"https://github.com/Ada-C11","followers_url":"https://api.github.com/users/Ada-C11/followers","following_url":"https://api.github.com/users/Ada-C11/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C11/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C11/subscriptions","organizations_url":"https://api.github.com/users/Ada-C11/orgs","repos_url":"https://api.github.com/users/Ada-C11/repos","events_url":"https://api.github.com/users/Ada-C11/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C11/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Ada-C11/Restricted-Arrays-Part1","description":"Assignment to work with array data structure or restricted arrays (as compared to Ruby Array class).","fork":true,"url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1","forks_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/forks","keys_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/teams","hooks_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/hooks","issue_events_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/events","assignees_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/tags","blobs_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/languages","stargazers_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/stargazers","contributors_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/contributors","subscribers_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/subscribers","subscription_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/subscription","commits_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/merges","archive_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/downloads","issues_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/labels{/name}","releases_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/releases{/id}","deployments_url":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/deployments","created_at":"2019-01-30T00:14:32Z","updated_at":"2019-03-20T17:14:22Z","pushed_at":"2019-04-10T23:12:57Z","git_url":"git://github.com/Ada-C11/Restricted-Arrays-Part1.git","ssh_url":"git@github.com:Ada-C11/Restricted-Arrays-Part1.git","clone_url":"https://github.com/Ada-C11/Restricted-Arrays-Part1.git","svn_url":"https://github.com/Ada-C11/Restricted-Arrays-Part1","homepage":"","size":10,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":43,"license":null,"forks":49,"open_issues":43,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/26"},"html":{"href":"https://github.com/Ada-C11/Restricted-Arrays-Part1/pull/26"},"issue":{"href":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/issues/26"},"comments":{"href":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-C11/Restricted-Arrays-Part1/statuses/d7fa92398d5108f7440dadeaecf2550ecbb616dd"}},"author_association":"NONE"}}
other: {"actor":{"display_login":"mmcknett"}}