Flipkart Coding Question – Solved

6 Live
Recruitment Software - Application Display Update There are N applicants who have applied for a job vacancy. Each applicant has an application ID ranging from 1 to N. During the initial round of recruitment, the company's software assigns each applicant a score value, which can be positive or negative: - A positive score indicates the applicant is qualified for the vacancy. - A negative score indicates the applicant is not qualified and is not visible to the recruiter. Recruiter's Request The recruiter wants access to all N applications, but they have a constraint of performing a maximum of K iterations to change the score values. Operations Allowed In each iteration, the recruiter can change the score value of the ith applicant from positive to negative or negative to positive. If there is an (i+1)th applicant, the software automatically changes their score as well. The goal is to ensure that all N applicants become visible to the recruiter in at most K iterations. Input Format First line: An integer application_size (N), representing the total number of applicants. Second line: N space-separated integers, representing the score values of all N applicants. Third line: An integer iterations (K), representing the maximum number of iterations allowed. Output Format Print space-separated integers, representing the application IDs whose scores must be changed by the recruiter in order to make all N applications visible.

Asked in: Flipkart

Image of the Question

Question Image Question Image

All Testcases Passed βœ”



Passcode Image

Solution


Please login to view the solution


Related Questions

| You are given a board of size M Γ— N where each cell can be either empty ('O') o… |
| Undirected Coloured Graph Shortest Path You are given an undirected weight… |
| Village Voyage A computer game "Village Voyage" has N villages (labeled 1 to… |
| Academic Decathlon Students are being selected for an academic decathlon tea… |
| Sum of Arrays Given two arrays each of length n, arr1 and arr2, in one opera… |
| Count Swaps During Custom Sorting Analyze the efficiency of the following so… |