Education + Jobs Hiring Website - 2025
0 like 0 dislike
22 views
Q 1. You are given an array which consists of numbers from 1 to K.

In one operation you can increase or decrease an element by one. Decreasing 1 makes it K and Increasing K makes it 1. What is the minimum number of operations required to make all elements equal

 

 

Q 2. You are given an array that contains some zero and non zero numbers you want to move all zeros to the end and all non zero element should be sorted in increasing order. You can only swap a non zero with a zero and you have to tell minimum number of swaps required to do this. (This was graph question I guess but I didn't understand initially)
ago in Online Assessments by Expert (139,570 points) | 22 views

Please log in or register to answer this question.