FastPrepFilter Team A Transfer Logs

Filter Team A Transfer Logs

Chainalysis logoChainalysis● EasyFULLTIMEONSITE INTERVIEW
Learn

Problem statement

Parallel arrays describe a stream of logs: teams[i] is the team and searchTypes[i] is the search type of log i.

Return the zero-based indices whose team is exactly Team A and whose search type is exactly transfer, preserving stream order.

Function

filterTeamATransferLogs(teams: String[], searchTypes: String[]) → int[]

Examples

Example 1

teams = ["Team A","Team B","Team A"]searchTypes = ["transfer","transfer","address"]return = [0]

Only the first log satisfies both predicates.

Example 2

teams = ["Team A","Team A"]searchTypes = ["Transfer","transfer"]return = [1]

Search-type matching is exact.

Constraints

  • The arrays have the same length from 0 through 100000.
  • Every value is a non-empty ASCII string.

More Chainalysis problems

See Chainalysis hiring insights
public int[] filterTeamATransferLogs(String[] teams, String[] searchTypes) {
    // write your code here
}
teams["Team A","Team B","Team A"]
searchTypes["transfer","transfer","address"]
expected[0]
Checking account…