Missing Jewelry Serial Numbers
Updated
Problem statement
Surviving jewelry items have the integer serial numbers in serials. Assume the original serial range was consecutive. Return the minimum number of missing distinct serial numbers consistent with the survivors: count the absent integers between the smallest and largest observed serial, inclusive. Duplicate observations count once. Return zero for an empty list.
Function
missingSerials(serials: int[]) → longExamples
Example 1
serials = [1,10]return = 8Serials 2 through 9 are missing.
Example 2
serials = [5,6,8]return = 1Only serial 7 is missing.
Constraints
- For this exercise, assume serials.length <= 200000 and -10^9 <= serials[i] <= 10^9.
More Intuit Online Assessment questions
- Employee Promotion OpportunitiesOA · Seen Oct 2026
- Next Pascal Row CoefficientOA · Seen Oct 2026
- Parse Router LogsOA · Seen Oct 2026
- Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
- Maximum Square-Free DivisorOA · Seen Oct 2026
- Two Tribes from Taller-Person CountsOA · Seen Oct 2026
- Shortest Path from an Encoded GraphOA · Seen Sep 2026
- Oldest and Youngest EmployeesOA · Seen Sep 2026
- Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
- Submask Sum QueriesOA · Seen Sep 2026
Similar questions at other companies
- Count User Mentions in Chat MessagesRamp · OARamp interview questions
- Count Valid Square PairsAuxoAI · OA
- Two SumAmazon · OA · PHONE SCREEN
- Find Words That Can Be Formed by CharactersTabaPay · OA
- Basic Item DiscountsPalantir · OAPalantir interview questions
- Word Frequency Counts in Alphabetical OrderAbridge · OAAbridge interview questions
- Customer Signer ScreeningState Farm · OA
- Minimum Magic Stones After MergesElevenLabs · OAElevenLabs interview questions
- K Most Recent Unique Request IDsMicrosoft · OAMicrosoft interview questions
- Distinct Products After Removing One ElementHSBC · OAHSBC interview questions