Practice
Resources
Contests
Online IDE
New
Free Mock
Scaler
Practice
Improve your coding skills with our resources
Contests
Compete in popular contests with top coders
Scaler
Explore Offerings by SCALER

Begin your success journey!

Sign Up using
Full name *
Email *
Password *

By creating an account, I acknowledge that I have read and agree to InterviewBit’s Terms and Privacy Policy .

Welcome back!

Log In using
Email *
Password *

Duplicates detection

Problem Description

Students of your class were provided a google form by the Class representative to fill up some fields like their ids,etc. But now the CR is facing a problem in which some students have filled the form multiple times. CR extracted the ids from the forms and stored them in a numpy array.


As his friend he asked you for writing a program which takes a numpy array of ids as an input returns a numpy array of same length in which the first occurence of each id is replaced by False (implying that these are not duplicates) and the repetitions are replaced by True.


You won't leave your friend hanging. So try to help him here.


Input Format: number of test cases space separated integers as the elements of the array for each test case in a new line

Output Format: simply printed numpy array of True,False for each test case in a new line


Sample Input: 1 0 0 3 0 2 4 2 2 2 2 Sample Output: [False True False True False False True True True True] Note: Here the numpy array is simply printed without any formatting and the code for taking input is already written.


Here you are expected to use numpy functions especially np.unique(), try to search about their use and do use them in the question.


Try to write a compact code using numpy builtin functions and try to explore their usage in different scenarios.

Start solving Duplicates detection on Interview Code Editor
Hints
  • Hints are not available for this problem

Discussion


Loading...
Click here to start solving coding interview questions
Free Mock Assessment
Fill up the details for personalised experience.
All fields are mandatory
Current Employer *
Enter company name *
Graduation Year *
Select an option *
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
Phone Number *
OTP will be sent to this number for verification
+1 *
+1
Change Number
Phone Number *
OTP will be sent to this number for verification
+1 *
+1
Change Number
Graduation Year *
Graduation Year *
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
*Enter the expected year of graduation if you're student
Current Employer *
Company Name *
Please verify your phone number
Edit
Resend OTP
By clicking on Start Test, I agree to be contacted by Scaler in the future.
Already have an account? Log in
Free Mock Assessment
Instructions from Interviewbit
Start Test