Тэги:
#deloitte #deloittecoding #deloittecodingquestions #deloittequestions #deloittepreparation #deloitte2023and2024 #deloitteoncampusКомментарии:
Great video! I would recommend getting a microphone, because sometimes it was difficult to hear/understand what you were saying.
Ответитьimport java.util.*;
public class class_monitor {
public static void main(String[] args) {
try (Scanner s = new Scanner(System.in)) {
int N = s.nextInt();
int a[] = new int[N];
for(int i=0;i<N;i++){
a[i]=s.nextInt();
}
int c=0;
int p=a[0];
for(int i=1;i<N;i++){
if(p>a[i]) c++;
p=a[i];
}
System.out.println(c);
}
}
}
If you don't mind please do videos on English communication skills ❤❤
ОтветитьTq for your supporting
ОтветитьThank You for such freemium content!
ОтветитьThe compiler was not good taking lot of time
Ответитьn=int(input())
ranks=list(map(int,input().split()))
cuts = sum(ranks[i+1] < ranks[i] for i in range(n-1))
print(cuts)
if you fancy one-liners here is one😁
price of prime?
ОтветитьI am in cbit and I got placed in Deloitte this year .. I got the corona virus question and another question.. another question was finding max number of possible pairs .. reply if you want the answer 😅
Ответитьhow much time did u actually took to solve this 2 questions and also how is your approach?
Ответить2nd question is basically finding the elements greater than all its prior elements. Comparing the local maxima with the next number ensures that. Well explained!!!
ОтветитьGreat explanation
ОтветитьIn 2 q the no they cut are 4,3,2 and 1 is the least rank so this will remain as the least rank in array,and will not be updated further, therfore the count comes 3, as minimum is updated 3 time for 4,3,2
Ответить