subject
Computers and Technology, 03.12.2020 16:30 WTDjase

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: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:20
What is the best assassins creed game?
Answers: 2
question
Computers and Technology, 24.06.2019 22:30
The a great imaginary circle, or reference line, around earth that is equally distant from the two poles and divides earth into the northern and southern hemispheres.
Answers: 1
question
Computers and Technology, 25.06.2019 08:10
Rom also called main memory or system memoryis used to stor the essential parts of the operating while the computer is running / true or false
Answers: 2
question
Computers and Technology, 25.06.2019 08:30
How do i comment on answers? there's one answer i'm confused about but i don't know how to comment on it
Answers: 2
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
Mathematics, 16.12.2021 07:40
question
English, 16.12.2021 07:40
question
Mathematics, 16.12.2021 07:40
question
Mathematics, 16.12.2021 07:40
Questions on the website: 13722359