{"action":"created","comment":{"url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments/85099244","pull_request_review_id":5832986,"id":85099244,"diff_hunk":"@@ -104,22 +104,47 @@ fun buildSumExample(list: List<Int>) = list.joinToString(separator = \" + \", post\n  * по формуле abs = sqrt(a1^2 + a2^2 + ... + aN^2).\n  * Модуль пустого вектора считать равным 0.0.\n  */\n-fun abs(v: List<Double>): Double = TODO()\n+fun abs(v: List<Double>): Double {\n+    if (v.isEmpty()) return 0.0\n+    var sum = 0.0\n+    for (element in v) {\n+        sum = sum + element * element\n+    }\n+    return Math.sqrt(sum)\n+}\n \n /**\n  * Простая\n  *\n  * Рассчитать среднее арифметическое элементов списка list. Вернуть 0.0, если список пуст\n  */\n-fun mean(list: List<Double>): Double = TODO()\n+fun mean(list: List<Double>): Double {\n+    if (list.isEmpty()) return (0.0)\n+    var sum = 0.0\n+    var size = 0\n+    for (element in list) {\n+        sum += element\n+        size++\n+    }\n+    return sum / size\n+}\n \n /**\n  * Средняя\n  *\n  * Центрировать заданный список list, уменьшив каждый элемент на среднее арифметическое всех элементов.\n  * Если список пуст, не делать ничего. Вернуть изменённый список.\n  */\n-fun center(list: MutableList<Double>): MutableList<Double> = TODO()\n+fun center(list: MutableList<Double>): MutableList<Double> {\n+    if (list.isNotEmpty()) {","path":"src/lesson4/task1/List.kt","position":38,"original_position":39,"commit_id":"e5c59fceb7732770f629e9536808a3522215835d","original_commit_id":"e5c59fceb7732770f629e9536808a3522215835d","user":{"login":"gagarski","id":6356608,"avatar_url":"https://avatars.githubusercontent.com/u/6356608?v=3","gravatar_id":"","url":"https://api.github.com/users/gagarski","html_url":"https://github.com/gagarski","followers_url":"https://api.github.com/users/gagarski/followers","following_url":"https://api.github.com/users/gagarski/following{/other_user}","gists_url":"https://api.github.com/users/gagarski/gists{/gist_id}","starred_url":"https://api.github.com/users/gagarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagarski/subscriptions","organizations_url":"https://api.github.com/users/gagarski/orgs","repos_url":"https://api.github.com/users/gagarski/repos","events_url":"https://api.github.com/users/gagarski/events{/privacy}","received_events_url":"https://api.github.com/users/gagarski/received_events","type":"User","site_admin":false},"body":"Пустой список можно не рассматривать, как особый случай. В случае пустого списка вы просто не попадёте в цикл.","created_at":"2016-10-26T11:09:47Z","updated_at":"2016-10-26T11:10:00Z","html_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/62#discussion_r85099244","pull_request_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments/85099244"},"html":{"href":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/62#discussion_r85099244"},"pull_request":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/62","id":85202421,"html_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/62","diff_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/62.diff","patch_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/62.patch","issue_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/62","number":62,"state":"open","locked":false,"title":"1-3 уроки","user":{"login":"VladislavMikh","id":22036059,"avatar_url":"https://avatars.githubusercontent.com/u/22036059?v=3","gravatar_id":"","url":"https://api.github.com/users/VladislavMikh","html_url":"https://github.com/VladislavMikh","followers_url":"https://api.github.com/users/VladislavMikh/followers","following_url":"https://api.github.com/users/VladislavMikh/following{/other_user}","gists_url":"https://api.github.com/users/VladislavMikh/gists{/gist_id}","starred_url":"https://api.github.com/users/VladislavMikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladislavMikh/subscriptions","organizations_url":"https://api.github.com/users/VladislavMikh/orgs","repos_url":"https://api.github.com/users/VladislavMikh/repos","events_url":"https://api.github.com/users/VladislavMikh/events{/privacy}","received_events_url":"https://api.github.com/users/VladislavMikh/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-14T10:23:52Z","updated_at":"2016-10-26T11:10:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ad04a00c1a0ae4425c85221633238ceb16b4cdd","assignee":{"login":"gagarski","id":6356608,"avatar_url":"https://avatars.githubusercontent.com/u/6356608?v=3","gravatar_id":"","url":"https://api.github.com/users/gagarski","html_url":"https://github.com/gagarski","followers_url":"https://api.github.com/users/gagarski/followers","following_url":"https://api.github.com/users/gagarski/following{/other_user}","gists_url":"https://api.github.com/users/gagarski/gists{/gist_id}","starred_url":"https://api.github.com/users/gagarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagarski/subscriptions","organizations_url":"https://api.github.com/users/gagarski/orgs","repos_url":"https://api.github.com/users/gagarski/repos","events_url":"https://api.github.com/users/gagarski/events{/privacy}","received_events_url":"https://api.github.com/users/gagarski/received_events","type":"User","site_admin":false},"assignees":[{"login":"gagarski","id":6356608,"avatar_url":"https://avatars.githubusercontent.com/u/6356608?v=3","gravatar_id":"","url":"https://api.github.com/users/gagarski","html_url":"https://github.com/gagarski","followers_url":"https://api.github.com/users/gagarski/followers","following_url":"https://api.github.com/users/gagarski/following{/other_user}","gists_url":"https://api.github.com/users/gagarski/gists{/gist_id}","starred_url":"https://api.github.com/users/gagarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagarski/subscriptions","organizations_url":"https://api.github.com/users/gagarski/orgs","repos_url":"https://api.github.com/users/gagarski/repos","events_url":"https://api.github.com/users/gagarski/events{/privacy}","received_events_url":"https://api.github.com/users/gagarski/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/62/commits","review_comments_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/62/comments","review_comment_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/62/comments","statuses_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/statuses/e5c59fceb7732770f629e9536808a3522215835d","head":{"label":"VladislavMikh:master","ref":"master","sha":"e5c59fceb7732770f629e9536808a3522215835d","user":{"login":"VladislavMikh","id":22036059,"avatar_url":"https://avatars.githubusercontent.com/u/22036059?v=3","gravatar_id":"","url":"https://api.github.com/users/VladislavMikh","html_url":"https://github.com/VladislavMikh","followers_url":"https://api.github.com/users/VladislavMikh/followers","following_url":"https://api.github.com/users/VladislavMikh/following{/other_user}","gists_url":"https://api.github.com/users/VladislavMikh/gists{/gist_id}","starred_url":"https://api.github.com/users/VladislavMikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladislavMikh/subscriptions","organizations_url":"https://api.github.com/users/VladislavMikh/orgs","repos_url":"https://api.github.com/users/VladislavMikh/repos","events_url":"https://api.github.com/users/VladislavMikh/events{/privacy}","received_events_url":"https://api.github.com/users/VladislavMikh/received_events","type":"User","site_admin":false},"repo":{"id":67538321,"name":"KotlinAsFirst2016","full_name":"VladislavMikh/KotlinAsFirst2016","owner":{"login":"VladislavMikh","id":22036059,"avatar_url":"https://avatars.githubusercontent.com/u/22036059?v=3","gravatar_id":"","url":"https://api.github.com/users/VladislavMikh","html_url":"https://github.com/VladislavMikh","followers_url":"https://api.github.com/users/VladislavMikh/followers","following_url":"https://api.github.com/users/VladislavMikh/following{/other_user}","gists_url":"https://api.github.com/users/VladislavMikh/gists{/gist_id}","starred_url":"https://api.github.com/users/VladislavMikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladislavMikh/subscriptions","organizations_url":"https://api.github.com/users/VladislavMikh/orgs","repos_url":"https://api.github.com/users/VladislavMikh/repos","events_url":"https://api.github.com/users/VladislavMikh/events{/privacy}","received_events_url":"https://api.github.com/users/VladislavMikh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/VladislavMikh/KotlinAsFirst2016","description":null,"fork":true,"url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016","forks_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/forks","keys_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/teams","hooks_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/hooks","issue_events_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/issues/events{/number}","events_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/events","assignees_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/assignees{/user}","branches_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/branches{/branch}","tags_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/tags","blobs_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/statuses/{sha}","languages_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/languages","stargazers_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/stargazers","contributors_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/contributors","subscribers_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/subscribers","subscription_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/subscription","commits_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/contents/{+path}","compare_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/merges","archive_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/downloads","issues_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/issues{/number}","pulls_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/pulls{/number}","milestones_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/milestones{/number}","notifications_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/labels{/name}","releases_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/releases{/id}","deployments_url":"https://api.github.com/repos/VladislavMikh/KotlinAsFirst2016/deployments","created_at":"2016-09-06T19:05:55Z","updated_at":"2016-09-06T19:05:57Z","pushed_at":"2016-10-26T10:48:02Z","git_url":"git://github.com/VladislavMikh/KotlinAsFirst2016.git","ssh_url":"git@github.com:VladislavMikh/KotlinAsFirst2016.git","clone_url":"https://github.com/VladislavMikh/KotlinAsFirst2016.git","svn_url":"https://github.com/VladislavMikh/KotlinAsFirst2016","homepage":null,"size":390,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Kotlin-Polytech:master","ref":"master","sha":"1be261c169c06dd8bf0ea258e4fe431d0ebb7a06","user":{"login":"Kotlin-Polytech","id":20967488,"avatar_url":"https://avatars.githubusercontent.com/u/20967488?v=3","gravatar_id":"","url":"https://api.github.com/users/Kotlin-Polytech","html_url":"https://github.com/Kotlin-Polytech","followers_url":"https://api.github.com/users/Kotlin-Polytech/followers","following_url":"https://api.github.com/users/Kotlin-Polytech/following{/other_user}","gists_url":"https://api.github.com/users/Kotlin-Polytech/gists{/gist_id}","starred_url":"https://api.github.com/users/Kotlin-Polytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kotlin-Polytech/subscriptions","organizations_url":"https://api.github.com/users/Kotlin-Polytech/orgs","repos_url":"https://api.github.com/users/Kotlin-Polytech/repos","events_url":"https://api.github.com/users/Kotlin-Polytech/events{/privacy}","received_events_url":"https://api.github.com/users/Kotlin-Polytech/received_events","type":"Organization","site_admin":false},"repo":{"id":67405509,"name":"KotlinAsFirst2016","full_name":"Kotlin-Polytech/KotlinAsFirst2016","owner":{"login":"Kotlin-Polytech","id":20967488,"avatar_url":"https://avatars.githubusercontent.com/u/20967488?v=3","gravatar_id":"","url":"https://api.github.com/users/Kotlin-Polytech","html_url":"https://github.com/Kotlin-Polytech","followers_url":"https://api.github.com/users/Kotlin-Polytech/followers","following_url":"https://api.github.com/users/Kotlin-Polytech/following{/other_user}","gists_url":"https://api.github.com/users/Kotlin-Polytech/gists{/gist_id}","starred_url":"https://api.github.com/users/Kotlin-Polytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kotlin-Polytech/subscriptions","organizations_url":"https://api.github.com/users/Kotlin-Polytech/orgs","repos_url":"https://api.github.com/users/Kotlin-Polytech/repos","events_url":"https://api.github.com/users/Kotlin-Polytech/events{/privacy}","received_events_url":"https://api.github.com/users/Kotlin-Polytech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016","description":null,"fork":false,"url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016","forks_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/forks","keys_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/teams","hooks_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/hooks","issue_events_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/events{/number}","events_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/events","assignees_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/assignees{/user}","branches_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/branches{/branch}","tags_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/tags","blobs_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/statuses/{sha}","languages_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/languages","stargazers_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/stargazers","contributors_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/contributors","subscribers_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/subscribers","subscription_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/subscription","commits_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/contents/{+path}","compare_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/merges","archive_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/downloads","issues_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues{/number}","pulls_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls{/number}","milestones_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/milestones{/number}","notifications_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/labels{/name}","releases_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/releases{/id}","deployments_url":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/deployments","created_at":"2016-09-05T09:06:26Z","updated_at":"2016-10-24T11:05:48Z","pushed_at":"2016-10-26T10:48:03Z","git_url":"git://github.com/Kotlin-Polytech/KotlinAsFirst2016.git","ssh_url":"git@github.com:Kotlin-Polytech/KotlinAsFirst2016.git","clone_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016.git","svn_url":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016","homepage":null,"size":18416,"stargazers_count":14,"watchers_count":14,"language":"Kotlin","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":98,"mirror_url":null,"open_issues_count":76,"forks":98,"open_issues":76,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/62"},"html":{"href":"https://github.com/Kotlin-Polytech/KotlinAsFirst2016/pull/62"},"issue":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/62"},"comments":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/Kotlin-Polytech/KotlinAsFirst2016/statuses/e5c59fceb7732770f629e9536808a3522215835d"}}}}
{"actor":{"display_login":"gagarski"}}