Last active
June 9, 2022 02:52
-
-
Save talenguyen/2db671bdf16389ae63f536a929d132d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Given an array of integers, find the first repeating element in it. | |
We need to find the element that occurs more than once and whose index of first occurrence is smallest. | |
Example 1: | |
- Input: arr = {10, 5, 3, 4, 3, 5, 6} | |
- Output: 5 | |
Example 2: | |
- Input: arr = {6, 10, 5, 4, 9, 120, 4, 6, 10} | |
- Output: 6 | |
*/ | |
void main() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment