Practice
Resources
Contests
Online IDE
New
Free Mock
Events New Scaler
Practice
Improve your coding skills with our resources
Contests
Compete in popular contests with top coders
logo
Events
Attend free live masterclass hosted by top tech professionals
New
Scaler
Explore Offerings by SCALER

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.
Phone Number *
OTP will be sent to this number for verification
+1 *
+1
Change Number
Graduation Year *
Graduation Year *
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
2028
2029
*Enter the expected year of graduation if you're student
Current Employer
Company Name
College you graduated from
College/University Name
Job Title
Job Title
Engineering Leadership
Software Development Engineer (Backend)
Software Development Engineer (Frontend)
Software Development Engineer (Full Stack)
Data Scientist
Android Engineer
iOS Engineer
Devops Engineer
Support Engineer
Research Engineer
Engineering Intern
QA Engineer
Co-founder
SDET
Product Manager
Product Designer
Backend Architect
Program Manager
Release Engineer
Security Leadership
Database Administrator
Data Analyst
Data Engineer
Non Coder
Other
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