Quick Overview

Count distinct values in a huge sorted random-access array without examining every element. Jump across equal-value runs with binary search to target O(d log n) time and O(1) auxiliary space when distinct values are sparse.

Count Distinct Values in a Huge Sorted Array

Company: LinkedIn

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Count distinct values in a huge sorted random-access array without examining every element. Jump across equal-value runs with binary search to target O(d log n) time and O(1) auxiliary space when distinct values are sparse.

Read the full LinkedIn Software Engineer interview experience this question came from

Loading…