Bitmaps Indicating Number Repetition Before/After Positions

Asked at SMBC · Coding Questions · Difficulty: Easy

Given an array, iterate through each number to determine if it has appeared before or after its current position. Fill `1` in the front bit if it appeared before, otherwise fill `0`. Similarly, fill `1` in the back bit if it appears after, otherwise fill `0`. Finally, return the list of the two bitmaps (as strings). Implement this algorithm and perform tests based on the input-output example below.

Loading the problem…