Sum All Ordered Decimal Concatenations
Updated
Problem statement
Given positive integers values, consider every ordered pair of elements, including pairing an index with itself. Concatenate their decimal representations in pair order and return the sum of all resulting numbers.
Function
sumOrderedConcatenations(values: int[]) → longExamples
Example 1
values = [2,10,3]return = 1845The nine ordered concatenations sum to 1845.
Example 2
values = [7]return = 77The only ordered pair concatenates 7 with itself.
Constraints
1 <= values.length <= 1000001 <= values[i] <= 1000000000- The answer fits in a signed 64-bit integer.
More ZipRecruiter Online Assessment questions
- Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
- Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
- Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
- Minimum Changes to Draw a YOA · Seen Oct 2024
- Apply Binary State OperationsOA · Seen Sep 2024
- Simulate Orchard Rot SpreadOA · Seen Sep 2024
- Compare Odd- and Even-Index SumsOA · Seen Sep 2024
- Coordinate Removals with Column GravityOA · Seen Sep 2024
- Lexicographically Smallest End ReversalOA · Seen Sep 2024
- Recursively Expanded Shell Command CountsOA · Seen Sep 2024
Similar questions at other companies
- Last Object to Fall Off the TableConfluent · OAConfluent interview questions
- Minimum Rounds to Complete All TasksInfosys · OAInfosys interview questions
- Capping Portfolio WeightsCapstone Investment Advisors · OA
- Count Subarrays with a Perfect-Square ProductMicrosoft · OAMicrosoft interview questions
- Repeated Mirror XORMathWorks · OAMathWorks interview questions
- Stacked Item and Category DiscountsPalantir · OAPalantir interview questions
- Minimize Adjacent Squared-Difference Cost with One InsertionMcKinsey & Company · OAMcKinsey & Company interview questions
- Maximize Revenue from Decreasing InventoryChubb · OAChubb interview questions
- Minimum Power-of-Two Removal OperationsIBM · OAIBM interview questions
- Macaron Order PriceOpenAI · OAOpenAI interview questions