Problem · Hash Table

Loyal Customers Across Two Days

EasyAmazonFULLTIMEONSITE INTERVIEW
See Amazon hiring insights

Problem statement

You are given two arrays of website logs, dayOneLogs and dayTwoLogs. Each log entry contains exactly three strings in this order: timestamp, customerId, and pageId.

The problem statement continues
Pro

Examples

Example 1

dayOneLogs = [["09:00","alice","home"],["09:05","alice","search"],["09:10","alice","checkout"],["10:00","bob","home"],["10:05","bob","search"],["10:10","bob","checkout"],["11:00","cara","home"],["11:05","cara","search"],["11:10","cara","checkout"]]dayTwoLogs = [["09:00","alice","home"],["09:05","alice","offers"],["09:10","alice","checkout"],["10:00","bob","home"],["10:05","bob","search"],["12:00","dan","home"],["12:05","dan","search"],["12:10","dan","checkout"]]return = ["alice"]

alice visits three distinct pages on each day. bob visits only two distinct pages on day two, cara is absent on day two, and dan is absent on day one.

FastPrep Pro
Reported in 1 Amazon interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 1 more worked example, explained
  • Guided hints and editorial
  • Run your code on real test cases
$9/month

Pro subscription, billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week
CodePython 3
Run and Submit unlock with Pro
FastPrep Pro
Reported in 1 Amazon interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 1 more worked example, explained
  • Guided hints and editorial
  • Run your code on real test cases
$9/month

Pro subscription, billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week