@@CodeBashers okay Can you please ask them on which platform they are writing coding test Is it mettle or Accenture's own ide I've exam in upcoming week
Anyone please tell me that everyone got different questions to solve in exam or every student in perticular batch have same questions plz reply anyone ❤
def count(arr,n): l=[] if len(set(arr))==1 or len(arr)==1: return 0 for i in arr: l.append(arr.count(i)) r=set(l) s=list(r) for j in s: return s[-2] n=int(input()) arr=list(map(int,input().split())) print(count(arr,n)) sir can i do like this for 1st question
It says that the array only has consecutive elements in sorted order so can't we just do secondLargest=arr[n-1]-1 . Arr[n-1] is the last element/largest element , so deducting 1 from the largest element will get us the second largest element as the elements are consecutive. I feel too dumb for thinking like this . And before this we'll do if(arr[0]==arr[n-1] return 0 for cases like [5,5,5,5] ,[6]
@@brokegod5871 no , it won't, you're not deducting 1 from the arr index you're deducting from the actual value , so the last index VALUE -1 will give the second largest number which is 2 in this case . Arr[n-1] means 3 and deducting 1 from 3 gives you 2
@@sravya_smj We are using string builder it is a kind of sting that is mutable...and yes append is used to add from last... so i added elements in string builder sb from the end only. After that for return purpose the stringbuilder is converted to string by using toString() function of string builder
First he converted arr into set so it will contain only distinct items, then he again converted that set to list, so he can access elements using index, then he accesses rearr[n-2] means 2nd largest element as arr is sorted, then he finds the count of 2nd largest element and returns, but this code contain an error that is if input arr contains same element for example : [5, 5,5,] then this code will throw an error as rearr[n-2] will give an index error
q.1 code for sorted as well as unsorted array--> #include using namespace std; int main() { int n; cin >> n; int arr[n]; unordered_map sst; for (int i = 0; i < n; i++) { cin >> arr[i]; sst[arr[i]]++; } int maxi =INT_MIN; for (int i = 0; i < n; i++) { if(arr[i] > maxi ){ maxi =arr[i]; } } int maxi2 = INT_MIN; for(int i=0;imaxi2 ){ maxi2 =arr[i]; } } cout
#include #include int main() { int len; scanf("%d",&len); int arr[len]; for (int i = 0; i =0) { if (arr[j]==seclong[0]) { seclong[1]++; } else { numtype++; if (numtype
✅✅Important IT Interview Subject Notes: topmate.io/code_bashers/1026390
can we use directive
How the compiler of accenture plz make a video on that
Yes please
Yes make a video
a = input()
b = input()
c = input()
temp = '/0'
a = a.replace(b,temp).replace(c,b).replace(temp,c)
print(a) for 2nd question
We can do the second question with the help of HASHMAPS , right ?
Sir can you tell us which type of question comes under easy and medium as there are two two question in accenture ?
Which topics we need to cover
bro jisne test de diya h kya wo pls bta skte ki kya dp ke vi ques a rhe
Is Accenture exam is offline or online 😅is it held in exam centers or one can write from home it self
Why don't you keep the screenshots of questions
So that we can know these are the actual oncampus asked questions
Bro exam are happening in College, i dont get images.
Students tell me verbally on telegram and then i make video.
@@CodeBashers okay
Can you please ask them on which platform they are writing coding test
Is it mettle or Accenture's own ide
I've exam in upcoming week
@@villain903 no its accenture platform , something called green.
1st question in JAVA
public static int occurrence(int[] arr, int size){
if(size == 0 || size == 1) return 0;
int max = arr[size-1];
int second_max = Integer.MAX_VALUE;
for(int i = size - 1; i > 0 ; i-- ){
if(max != arr[ i - 1 ]){
second_max = arr[ i - 1 ];
break;
}
}
System.out.println("Second largest = "+ second_max);
int cnt = 0;
for(int i : arr){
if(i == second_max){
cnt++;
}
}
return cnt;
}
Sir can I use any short cut key while coding like ctrl c
Anyone please tell me that everyone got different questions to solve in exam or every student in perticular batch have same questions plz reply anyone ❤
Sir make a playlist on cognitive Assment and technical mcq
Check out onlinestudy4u yt
def count(arr,n):
l=[]
if len(set(arr))==1 or len(arr)==1:
return 0
for i in arr:
l.append(arr.count(i))
r=set(l)
s=list(r)
for j in s:
return s[-2]
n=int(input())
arr=list(map(int,input().split()))
print(count(arr,n))
sir can i do like this for 1st question
Bro please help us in doing videos in python3
Brother i have very honest question please reply , can we use vector, or we cannot use vector
you can definitely use vector
who said you cannot use
U can use
We are having the DELTAX company on campus drive in our college on August 31st...can you please give me the tips sir!!!!
I have exact mcqs question pdfs and coding questions also
@@sandeepsadhu56 then plz do share
@@varshithareddy7118 how
@@varshithareddy7118 link was deleted by TH-cam policies when I was sent..
How I will sent?
How?
It says that the array only has consecutive elements in sorted order so can't we just do secondLargest=arr[n-1]-1 . Arr[n-1] is the last element/largest element , so deducting 1 from the largest element will get us the second largest element as the elements are consecutive. I feel too dumb for thinking like this . And before this we'll do if(arr[0]==arr[n-1] return 0 for cases like [5,5,5,5] ,[6]
@@brokegod5871 no , it won't, you're not deducting 1 from the arr index you're deducting from the actual value , so the last index VALUE -1 will give the second largest number which is 2 in this case . Arr[n-1] means 3 and deducting 1 from 3 gives you 2
My bad, I read it wrong @@tanishatalukdar9653
@@tanishatalukdar9653I read it wrong
Fact check..... repetition is there fyi
Bro the second question is previously asked question same to same
Yesss 👍👍👍
Did you gave the accenture drive test?
@@bossnation8921 no i am just gonna give it
But I m solving previous year problems so i recognised that 😀
what if the array is not sorted
Its given always sorted in ques
s=input()
s1=input()
s2=input()
if s1 in s:
s=s.replace(s1,s2)
if s2 in s:
s=s.replace(s2,s1)
print(s)
can u please tell why it is not working..
u should use a place holder
In which college this drive is conducted
Anyone received communication round test link in email or something???
u are wrong about saying accenture only asks to write function. they ask too write whole code i wrote yesterday
I mentioned this also in video 🙂🙂
Which plateform bro coding is in?
@@CodeBashers in previous videos u said only function
@@kurisettisaisujith7453 it's their own ide
@@satosugu143 I seen that some of previous are in mettle
question 2 ... JAVA code:-
public static String replaced(String word, char ch1, char ch2){
StringBuilder sb = new StringBuilder( );
for(int i =0 ; i < word.length() ; i++){
char single = word.charAt( i );
if(single == ch1){
sb.append(ch2);
continue;
}
if(single == ch2){
sb.append(ch1);
continue;
}
sb.append(single);
}
return sb.toString( );
}
genuine doubt...isnt append used for adding to the last end...so how can it replace specified parts that are in the middle or some other place??
@@sravya_smj We are using string builder it is a kind of sting that is mutable...and yes append is used to add from last... so i added elements in string builder sb from the end only.
After that for return purpose the stringbuilder is converted to string by using toString() function of string builder
arr = [1,2,3,3,4,4,4,4,5,5,5]
se = set(arr)
rearr = list(se)
selar = rearr[-2]
print(arr.count(selar))
First he converted arr into set so it will contain only distinct items, then he again converted that set to list, so he can access elements using index, then he accesses rearr[n-2] means 2nd largest element as arr is sorted, then he finds the count of 2nd largest element and returns, but this code contain an error that is if input arr contains same element for example : [5, 5,5,] then this code will throw an error as rearr[n-2] will give an index error
@@uniqueabx9 yesss for that condition I didn't write the lines of code 😂 I know that...
But to solve that error just write
If len(se)
@@uniqueabx9 you explained my code very nicely 👍
q.1 code for sorted as well as unsorted array-->
#include
using namespace std;
int main() {
int n;
cin >> n;
int arr[n];
unordered_map sst;
for (int i = 0; i < n; i++) {
cin >> arr[i];
sst[arr[i]]++;
}
int maxi =INT_MIN;
for (int i = 0; i < n; i++) {
if(arr[i] > maxi ){
maxi =arr[i];
}
}
int maxi2 = INT_MIN;
for(int i=0;imaxi2 ){
maxi2 =arr[i];
}
}
cout
#include
#include
int main()
{
int len;
scanf("%d",&len);
int arr[len];
for (int i = 0; i =0)
{
if (arr[j]==seclong[0])
{
seclong[1]++;
}
else
{
numtype++;
if (numtype
import java.util.*;
class HelloWorld {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
char ch1 = sc.next().charAt(0);
char ch2 = sc.next().charAt(0);
String temp = str.replace(ch1,'\0');
temp = temp.replace(ch2,ch1);
String fin = temp.replace('\0', ch2);
System.out.print(fin);
}
}
simple java code - 2