← 返回 salesforce 的题目列表Check Duplicates in Array
类型:online_judge
Given an array of integers nums, for each index i, perform the following checks:
Check if nums[i] has appeared on the left side of nums. If so, fill string1 at position i with '1', otherwise fill with '0'.
Check if nums[i] will appear again on the right side of nums. If so, fill string2 at position i with '1', otherwise fill with '0'.
Finally, return an array of the two binary strings [string1, string2].
Example
Input
4
1 2 1 3