{"id":19281561,"url":"https://github.com/pragalbha-patil/cyclic-array-challenge-javascript","last_synced_at":"2025-07-03T09:03:40.946Z","repository":{"id":111710623,"uuid":"267865019","full_name":"Pragalbha-Patil/Cyclic-array-challenge-Javascript","owner":"Pragalbha-Patil","description":"A cyclic array challenge implemented in Javascript","archived":false,"fork":false,"pushed_at":"2020-05-29T13:40:29.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T14:13:19.516Z","etag":null,"topics":["algorithm","javascript","problem-solving"],"latest_commit_sha":null,"homepage":"https://codepen.io/Pragalbha-Patil/pen/ExVBVza","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pragalbha-Patil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-29T13:29:56.000Z","updated_at":"2020-08-14T13:57:30.000Z","dependencies_parsed_at":"2023-07-20T18:15:12.565Z","dependency_job_id":null,"html_url":"https://github.com/Pragalbha-Patil/Cyclic-array-challenge-Javascript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pragalbha-Patil%2FCyclic-array-challenge-Javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pragalbha-Patil%2FCyclic-array-challenge-Javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pragalbha-Patil%2FCyclic-array-challenge-Javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pragalbha-Patil%2FCyclic-array-challenge-Javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pragalbha-Patil","download_url":"https://codeload.github.com/Pragalbha-Patil/Cyclic-array-challenge-Javascript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240385977,"owners_count":19793105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","javascript","problem-solving"],"created_at":"2024-11-09T21:23:21.921Z","updated_at":"2025-02-23T22:19:43.360Z","avatar_url":"https://github.com/Pragalbha-Patil.png","language":"JavaScript","readme":"# Cyclic array challenge\n\nCyclic array challenge implemented in Javascript\n\n## Problem Statement\n\nA cyclic array A having N numbers, and he has to perform Q operations on this array. In each operation the coach would provide him with a number X. After each operation, every element of the cyclic array would be replaced by the sum of itself and the element lying X positions behind it in the cyclic array. All these replacements take place simultaneously. For example, if the cyclic array was [a, b, c, d], then after the operation with X = 1, the new array would be [a+d, b+a, c+b, d+c]. He needs to output the sum of the elements of the final array modulus 10^9+7.\n\n## Input\n\nThe first line of each test file contains a integer N (1 \u003c= N \u003c= 100000). The next line contains N space separated integers which represent the elements of the cyclic array ( 1 \u003c= Ai \u003c= 10^9 ). The third line contains a integer Q (0 \u003c= Q \u003c= 1000000) representing the number of operations that will be applied to the array. Finally, Q lines follow, each one containing an integer X (0 \u003c= X \u003c N).\n\n## Output\nYour program should output to the standard output stream the sum of the elements of the final array modulus 10^9+7. Note: There is a newline character at the end of the last line of the output.\n\n## Sample Input\n5 (# no.of integers in the following array)\n\n1 2 3 4 5 ( # array itself)\n\n2 (# no.of Q operations)\n\n1 (# Q1 value)\n\n0 (# Q2 value)\n\n## Sample output \n60\n\n## Explanation of Sample Input\n\nAfter the 1st operation (X = 1), the array would be [1+5, 2+1, 3+2, 4+3, 5+4] = [6, 3, 5, 7, 9]\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpragalbha-patil%2Fcyclic-array-challenge-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpragalbha-patil%2Fcyclic-array-challenge-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpragalbha-patil%2Fcyclic-array-challenge-javascript/lists"}