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 04:30
What kind of software users of all skill levels create web pages that include graphics, video, audio, animation, and other special effects? website authoring website software website publishing website editing
Answers: 1
question
Computers and Technology, 22.06.2019 12:30
Some of the first computer games were created in the early 1970s by college students experimenting after hours to see what the were capable of doing.
Answers: 3
question
Computers and Technology, 22.06.2019 13:00
Which part of the cpu accepts data?
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
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
Computers and Technology, 12.07.2019 12:30