subject

Given an array of positive integers a, your task is to calculate the sum of every possible a[i] ∘a[j], where a[i]∘a[j] is the concatenation of the string representations of a[i] and a[j] respectively. examplefor a = [10, 2], the output should be concatenationssum(a) = 1344.a[0] ∘a[0] = 10 ∘10 = 1010,a[0] ∘a[1] = 10 ∘2 = 102,a[1] ∘a[0] = 2 ∘10 = 210,a[1] ∘a[1] = 2 ∘2 = 22.so the sum is equal to 1010 + 102 + 210 + 22 = 1344.for a = [8], the output should be concatenationssum(a) = 88.there is only one number in a, and a[0] ∘a[0] = 8 ∘8 = 88, so the answer is 88.input/output[execution time limit] 3 seconds (java)[input] array. integer aa non-empty array of positive integers. guaranteed constraints: 1 ≤ a. length ≤ 105,1 ≤ a[i] ≤ 106.[output] integer64the sum of all a[i] ∘a[j]s. it's guaranteed that the answer is less than 253.[java] syntax tips

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Andrina writes letters that are regularly sent to hundreds of her company’s customers. because of this, she would like for the mail merge command to be in her quick access toolbar, and she wants it to be the first button on the left. what should andrina do to place the mail merge button there?
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
To increase sales, robert sends out a newsletter to his customers each month, letting them know about new products and ways in which to use them. in order to protect his customers' privacy, he uses this field when addressing his e-mail. attach bcc forward to
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Open this link after reading about ana's situation. complete each sentence using the drop-downs. ana would need a minimum of ato work as a translator. according to job outlook information, the number of jobs for translators willin the future.
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
You know the right answer?
Given an array of positive integers a, your task is to calculate the sum of every possible a[i] ∘a[j...
Questions
question
Chemistry, 08.07.2019 01:00
question
Mathematics, 08.07.2019 01:00
Questions on the website: 13722359