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, 22.06.2019 16:20
Consider the following statements, then select one of the answers below: the signal() function shown below registers "sig_handler()" as the signal handler function for the sigkill signal, without the complexity of using when the sigkill signal is sent to a process running this code, by a user typing "kill -kill ", where the correct process id is used for to target the process, sig_handler() will be executed.
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What side length would you specify if you were required to create a regular hexagonal plate that was composed of 33 cm(squared) of sheet metal? dimension the side length to 0.1 cm
Answers: 2
question
Computers and Technology, 22.06.2019 22:00
Competent nonverbal communication involves interacting with others in a manner that is appropriate for which of the following? select all that apply. situation task individuals
Answers: 3
question
Computers and Technology, 23.06.2019 13:00
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
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, 29.10.2020 21:10
question
Mathematics, 29.10.2020 21:10
question
Physics, 29.10.2020 21:10
question
Computers and Technology, 29.10.2020 21:10
question
English, 29.10.2020 21:10
question
Mathematics, 29.10.2020 21:10
question
Computers and Technology, 29.10.2020 21:10