First question in java import java.util.*; public class First1 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); System.out.print("Enter array size:"); int size=sc.nextInt();
In java use treeset to add even and odd numbers which stores the value in ascending order.then to get. Second largest number use the method lower(set.last()) which gives second largest.🙌
In first question you must want to explain the constraints what if the n value is 3 then the the odd array will be of 1 element and even array will be of 2 elements then there is index at -2
Join our TA Support Group on Discord, where we will help you out with all your queries: 📍prepinsta.com/discord/ If you are new to Discord, please watch our tutorial here❤️: bit.ly/how-to-use-prepinsta-discord-server
for 1st que please check is this is ok or not size = int (input ("Enter the size of the matrix: ")) arr = [int(x) for x in input("Enter th array elements with space: ").split()] print(arr) o = [] e = [] for i in range(len(arr)): if i % 2 == 0: e.append(arr[i]) else: o.append(arr[i]) e.sort() o.sort() print(e) print(o) print(e[-2] + o[-2])
Hey there! 💕 We're really glad we could help -- we're sure you'll find PrepInsta Prime really helpful too! Wishing you the very best for your placement preparations 🤗 Feel free to reach out to us over Instagram: www.prepinsta.com/instagram/ Or drop a message on bit.ly/primeWA Or call us on 8448440710. Our mentors would be very glad to help you out with your queries and placement. Team PrepInsta is always here to help!
Hey there Tejas! 💕 We're glad we could help, wishing you the very best for your preparations! 🤗 Feel free to reach out to us over Instagram: www.prepinsta.com/instagram/ Or drop a message on bit.ly/primeWA Or call us on 8448440710. Our mentors would be very glad to help you out with your queries and placement. Team PrepInsta is always here to help!
Hey you guys are too good man, I am from electrical engg background but your explanation was top notch, you really got into basics so that any new programmer could understand it very easily. Thank you for the help🔝🔝✔🔶
brother i have a doubt.matrix has rows and colums but you take array is this correct code?.finally your explanation was awesome and loved to way understand
Join our TA Support Group on Discord, where we will help you out with all your queries: 📍prepinsta.com/discord/ If you are new to Discord, please watch our tutorial here❤️: bit.ly/how-to-use-prepinsta-discord-server
Hey😊 We are blessed to be useful for your placements.❤ It would be great if you stay connected to us over our socials! Follow our social media handles listed below. Telegram- prepinsta.com/telegram/ Instagram- prepinsta.com/instagram/ WhatsApp- prepinsta.com/whatsapp/ RUclips- ruclips.net/user/prepinsta LinkedIn- www.linkedin.com/company/prepinsta/ Discord- prepinsta.com/discord
Hi, Yayyy you answered. Kindly join us here for more details. Join our TA Support Group on Discord, where we will help you out with all your queries: 📍prepinsta.com/discord/
Hey there Kirandeep! 💕 That means a lot, y'all keep us going. Wishing you the very best for your placement preparations! 🤗 Feel free to reach out to us over Instagram: www.prepinsta.com/instagram/ Or drop a message on bit.ly/primeWA Or call us on 8448440710. Our mentors would be very glad to help you out with your queries and placement. Team PrepInsta is always here to help!
array = [] evenArr = [] oddArr = [] n = int(input("enter a size of array")) for i in range (0,n): number = int(input("enter a element at {}index:".format(i))) array.append(number) if i % 2 == 0: evenArr.append(array[i]) else: oddArr.append(array[i]) evenArr = sorted(evenArr) print("sorted evenArr:",evenArr[0:len(evenArr)]) oddArr = sorted(oddArr) print("sorted oddArr:",oddArr[0:len(oddArr)]) print ("sum of second largest elements:",evenArr[-2] + oddArr[-2])
Hey, kindly check out the Accenture exam pattern below👇 prepinsta.com/accenture/test-pattern-exam/ In case of any doubt reach out to us on our socials: Telegram- prepinsta.com/telegram/ Instagram- prepinsta.com/instagram/ WhatsApp- prepinsta.com/whatsapp/
Where can I give the exam for Accenture PADA role? At home or at centre? Please reply. 🙏 Actually I have no idea about this. Is mock assessment given at home or at centre? If the exam can be given from home then I have to make necessary arrangements. Please reply sir. 🙏
Hey there Gopal! 💕 That means a lot, you guys keep us going. Wishing you the very best for your placements! 🤗 Feel free to reach out to us over Instagram: www.prepinsta.com/instagram/ Or drop a message on bit.ly/primeWA Or call us on 8448440710. Our mentors would be very glad to help you out with your queries and placement. Team PrepInsta is always here to help!
Code 1 Ans:(Python3) a=int(input("Enter the size of the array: ")) b=[] while a>0: c=int(input("Enter the element: ")) b.append(c) a-=1 c=[] e=[] for d in range(len(b)): if d%2==0: c.append(b[d]) else: e.append(b[d]) c.sort() e.sort() print(c,e) z=c[len(c)-2] x=e[len(e)-2] print(z,x) print("The Sum is ",z+x)
Join our TA Support Group on Discord, where we will help you out with all your technical queries: 📍prepinsta.com/discord/ If you are new to Discord, please watch our tutorial here❤️: bit.ly/how-to-use-prepinsta-discord-server
Hey, we recommend you not to limit learning, these questions are definitely fruitful for your preparation but not everything so practice as much as you can 😊 You can refer the link to get more idea: prepinsta.com/accenture/coding/
1)l=[] j=[] k=[] s=[] n=int(input("enter the value of n")) for i in range(n): a=int(input("enter the value of a")) l.append(a) print(l) if(i%2==0): j.append(a) j=sorted(j) else: k.append(a) k=sorted(k) s.append(max(k)) s.append(max(j)) print(j) print(k) print(min(s))
Join our TA Support Group on Discord, where we will help you out with all your technical queries: 📍prepinsta.com/discord/ If you are new to Discord, please watch our tutorial here❤️: bit.ly/how-to-use-prepinsta-discord-server
Hey there💚, Accenture is hiring on campus currently, and for off campus updates, you can follow our off campus instagram handle. Link : instagram.com/prepinsta.offcampus/?hl=en
import java.util.*; public class Main { public static void main(String[] args) { int arr[]={3,4,1,7,9}; TreeSet odd=new TreeSet(); TreeSet even=new TreeSet(); for(int i=0;i
*Java* 1st question import java.util.Arrays; public class MyClass { public static void main(String args[]) { int a[]={3,4,1,7,9}; int evenSize=a.length%2==0?a.length/2:(a.length/2)+1; int oddSize=a.length-evenSize; int oddArray[]=new int[oddSize]; int evenArray[]=new int[evenSize]; int inc=0; for(int i=0;i
Join our TA Support Group on Discord, where we will help you out with all your queries: 📍prepinsta.com/discord/ If you are new to Discord, please watch our tutorial here❤️: bit.ly/how-to-use-prepinsta-discord-server
Hi, The company is hiring On Campus and for the further instructions you can checkout the information with the TPO or college placement cell. Ps.....You can DM us on 8448440710 on WhatsApp for personalized guidance and can give us an instant call.
Hey there, connect to our mentors on Discord to get your queries solved💚, Join our TA Support Group on Discord, where we will help you out with all your queries: 📍prepinsta.com/discord/ If you are new to Discord, please watch our tutorial here❤️: bit.ly/how-to-use-prepinsta-discord-server
Hey there Prathamesh! 💕 That means a lot to us! Wishing you the very best for your preparations -- Hope to see you on PrepInsta Prime too 💚 Feel free to reach out to us over Instagram: www.prepinsta.com/instagram/ Or drop a message on bit.ly/primeWA Or call us on 8448440710. Our mentors would be very glad to help you out with your queries and placement. Team PrepInsta is always here to help!
Hello, where did you give your exam? At home or at centre? Actually I have no idea about this. Can I give the exam from home or i have to go to centre? And the mock assessment is taken at home or at centre? Because i have to make necessary arrangements then. Please reply bro. 🙏
make me correct if their is any easy way //Check Password public class prg34 { public static void main(String[] args) { Scanner scan=new Scanner(System.in); String str=scan.nextLine(); int l=str.length(); int special=0; int upper=0; int lower=0; int number=0; for(int i=0;i='A'&&str.charAt(i)='a'&&str.charAt(i)=1&&upper>=1&&upper+lower>=4&&special>=1) { System.out.println(0); }else { System.out.println(1); } } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int sum=0; int n=sc.nextInt(); int a[]=new int[n]; for(int i=0;i=2) sum+=odd.get(odd.size()-2); System.out.print(sum); } }
As a mechanical engineering graduate i understood your explanation, that tells us that you did a great job, nice explanation 👍
Stay connected❤️
I am also studying mechanical engineering...how did u prepare coding for Accenture...can I get ur mobile number
First question in java
import java.util.*;
public class First1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
System.out.print("Enter array size:");
int size=sc.nextInt();
int [] array1=new int[size];
for(int i=0;i
what if largest element present 2 times then your answer will be wrong
what if input is [ 1 ,1,2] . 0th index is add . !
@@karmegamm4461then make a condition that will check the length
In java use treeset to add even and odd numbers which stores the value in ascending order.then to get. Second largest number use the method lower(set.last()) which gives second largest.🙌
We, the social media team is quite not confirmed about the answers but for sure our mentors will let you know soooon
In first question you must want to explain the constraints what if the n value is 3 then the the odd array will be of 1 element and even array will be of 2 elements then there is index at -2
Join our TA Support Group on Discord, where we will help you out with all your queries:
📍prepinsta.com/discord/
If you are new to Discord, please watch our tutorial here❤️: bit.ly/how-to-use-prepinsta-discord-server
for 1st que please check is this is ok or not
size = int (input ("Enter the size of the matrix: "))
arr = [int(x) for x in input("Enter th array elements with space: ").split()]
print(arr)
o = []
e = []
for i in range(len(arr)):
if i % 2 == 0:
e.append(arr[i])
else:
o.append(arr[i])
e.sort()
o.sort()
print(e)
print(o)
print(e[-2] + o[-2])
thanks prepinsta video is very helpful I have Accenture paper on August and this help me a lot thanks for support ❤
Hey there! 💕
We're really glad we could help -- we're sure you'll find PrepInsta Prime really helpful too! Wishing you the very best for your placement preparations 🤗
Feel free to reach out to us over Instagram: www.prepinsta.com/instagram/
Or drop a message on bit.ly/primeWA
Or call us on 8448440710. Our mentors would be very glad to help you out with your queries and placement.
Team PrepInsta is always here to help!
for second que can we use regex?
Really useful thanks Prepinsta for sharing!
Hey there Tejas! 💕
We're glad we could help, wishing you the very best for your preparations! 🤗
Feel free to reach out to us over Instagram: www.prepinsta.com/instagram/
Or drop a message on bit.ly/primeWA
Or call us on 8448440710. Our mentors would be very glad to help you out with your queries and placement.
Team PrepInsta is always here to help!
one the best platform for learning technical courses
Hey you guys are too good man, I am from electrical engg background but your explanation was top notch, you really got into basics so that any new programmer could understand it very easily. Thank you for the help🔝🔝✔🔶
Stay connected❤️
brother i have a doubt.matrix has rows and colums but you take array is this correct code?.finally your explanation was awesome and loved to way understand
Can we use STL functions to solve the problems?
Can we write the code is JS too? or we have to go with C,CPP, Java and Python only?
C,CPP, Java and Python only
Is Javascript programming language selection is available in the language selection option
We have Javascript included in Full Stack Development course on PrepInsta Prime.
It said matrix right and matrix is not single array its an array within an array
Join our TA Support Group on Discord, where we will help you out with all your queries:
📍prepinsta.com/discord/
If you are new to Discord, please watch our tutorial here❤️: bit.ly/how-to-use-prepinsta-discord-server
Exactly the question is misleading
I am preparing for Accenture this adds value for my preparation.
Thankyou PrepInsta❤
Stay connected❤️
Do they allow the use of Collection Framework Or STL library?
Yes
Sir your explanation was very good 🎉🎉❤
Hey. we are glad to hear to that
@@PrepInsta I registered for Accenture on August 3 when i will get slot for test plz reply sir
just subscribed bcoz of your explanation
nice explanation ,loved it man ❤❤❤
Yayyy! Thank you ☺
Thank you so much ❣️🥰
Yayyy
thanks guys
Helpful video
Hey😊
We are blessed to be useful for your placements.❤
It would be great if you stay connected to us over our socials!
Follow our social media handles listed below.
Telegram- prepinsta.com/telegram/
Instagram- prepinsta.com/instagram/
WhatsApp- prepinsta.com/whatsapp/
RUclips- ruclips.net/user/prepinsta
LinkedIn- www.linkedin.com/company/prepinsta/
Discord- prepinsta.com/discord
Is python option available for Accenture and other companies?
Hi, Yes, candidates can use Python for coding. Also, checkout Python Tutorial here on prepinsta.com/python
if it have a 2 dimension or 3 dimension matrix then what will we do?????????????
@PrepInsta
Hi, Great you have answered. For technical related queries you can freely connect with our TA's on discord. Here is the link prepinsta.com/discord
Can i get prime access
Kindly DM us on 8448440710, our team would be glad to guide 💚
In any company coding round we can use methods or functions?
Hi, Yayyy you answered. Kindly join us here for more details.
Join our TA Support Group on Discord, where we will help you out with all your queries:
📍prepinsta.com/discord/
Can We do this program using array list
Hi, For technical related queries you can freely connect with our TA's on discord. Here is the link prepinsta.com/discord
Good Explanation
Hey there Kirandeep! 💕
That means a lot, y'all keep us going. Wishing you the very best for your placement preparations! 🤗
Feel free to reach out to us over Instagram: www.prepinsta.com/instagram/
Or drop a message on bit.ly/primeWA
Or call us on 8448440710. Our mentors would be very glad to help you out with your queries and placement.
Team PrepInsta is always here to help!
array = []
evenArr = []
oddArr = []
n = int(input("enter a size of array"))
for i in range (0,n):
number = int(input("enter a element at {}index:".format(i)))
array.append(number)
if i % 2 == 0:
evenArr.append(array[i])
else:
oddArr.append(array[i])
evenArr = sorted(evenArr)
print("sorted evenArr:",evenArr[0:len(evenArr)])
oddArr = sorted(oddArr)
print("sorted oddArr:",oddArr[0:len(oddArr)])
print ("sum of second largest elements:",evenArr[-2] + oddArr[-2])
First code
do we need to write whole code or just function
Hey, kindly check out the Accenture exam pattern below👇
prepinsta.com/accenture/test-pattern-exam/
In case of any doubt reach out to us on our socials:
Telegram- prepinsta.com/telegram/
Instagram- prepinsta.com/instagram/
WhatsApp- prepinsta.com/whatsapp/
Where can I give the exam for Accenture PADA role? At home or at centre? Please reply. 🙏 Actually I have no idea about this. Is mock assessment given at home or at centre? If the exam can be given from home then I have to make necessary arrangements. Please reply sir. 🙏
Second largest is 7 right in the 2nd matrix why he choosen the 4 can anyone tell.?
Really good
Hey there Gopal! 💕
That means a lot, you guys keep us going. Wishing you the very best for your placements! 🤗
Feel free to reach out to us over Instagram: www.prepinsta.com/instagram/
Or drop a message on bit.ly/primeWA
Or call us on 8448440710. Our mentors would be very glad to help you out with your queries and placement.
Team PrepInsta is always here to help!
Code 1 Ans:(Python3)
a=int(input("Enter the size of the array: "))
b=[]
while a>0:
c=int(input("Enter the element: "))
b.append(c)
a-=1
c=[]
e=[]
for d in range(len(b)):
if d%2==0:
c.append(b[d])
else:
e.append(b[d])
c.sort()
e.sort()
print(c,e)
z=c[len(c)-2]
x=e[len(e)-2]
print(z,x)
print("The Sum is ",z+x)
Join our TA Support Group on Discord, where we will help you out with all your technical queries:
📍prepinsta.com/discord/
If you are new to Discord, please watch our tutorial here❤️:
bit.ly/how-to-use-prepinsta-discord-server
I too have the exam bro tommorrow plz help me
Sir is these questions enhalf for codeing round
Hey, we recommend you not to limit learning, these questions are definitely fruitful for your preparation but not everything so practice as much as you can 😊
You can refer the link to get more idea: prepinsta.com/accenture/coding/
1)l=[]
j=[]
k=[]
s=[]
n=int(input("enter the value of n"))
for i in range(n):
a=int(input("enter the value of a"))
l.append(a)
print(l)
if(i%2==0):
j.append(a)
j=sorted(j)
else:
k.append(a)
k=sorted(k)
s.append(max(k))
s.append(max(j))
print(j)
print(k)
print(min(s))
Join our TA Support Group on Discord, where we will help you out with all your technical queries:
📍prepinsta.com/discord/
If you are new to Discord, please watch our tutorial here❤️:
bit.ly/how-to-use-prepinsta-discord-server
bro the link given in the description for the coding and answer is not working, what's the problem?
It's working fine at our end, kindly try again.
Super ,do more videos on coding bro
Thanks and Sure❤️
When did this test happen?
Hey there💚, Accenture is hiring on campus currently, and for off campus updates, you can follow our off campus instagram handle.
Link : instagram.com/prepinsta.offcampus/?hl=en
import java.util.*;
public class Main
{
public static void main(String[] args) {
int arr[]={3,4,1,7,9};
TreeSet odd=new TreeSet();
TreeSet even=new TreeSet();
for(int i=0;i
Hey, we got pretty late with the response 🥺 How was your test?
*Java*
1st question
import java.util.Arrays;
public class MyClass {
public static void main(String args[]) {
int a[]={3,4,1,7,9};
int evenSize=a.length%2==0?a.length/2:(a.length/2)+1;
int oddSize=a.length-evenSize;
int oddArray[]=new int[oddSize];
int evenArray[]=new int[evenSize];
int inc=0;
for(int i=0;i
Your are genius bro
Will you please do in C?
@@donna4499 Yeah sure
Join our TA Support Group on Discord, where we will help you out with all your queries:
📍prepinsta.com/discord/
If you are new to Discord, please watch our tutorial here❤️: bit.ly/how-to-use-prepinsta-discord-server
bro what if largest element is present 2 times you will get wrong answer right??
Bro interview online or offline
Hi, The company is hiring On Campus and for the further instructions you can checkout the information with the TPO or college placement cell.
Ps.....You can DM us on 8448440710 on WhatsApp for personalized guidance and can give us an instant call.
we can use quicksort instead of build in sort() methods.
Hey there, connect to our mentors on Discord to get your queries solved💚,
Join our TA Support Group on Discord, where we will help you out with all your queries:
📍prepinsta.com/discord/
If you are new to Discord, please watch our tutorial here❤️: bit.ly/how-to-use-prepinsta-discord-server
always best platform (prepinsta) to crack coding rounds
Hey there Prathamesh! 💕
That means a lot to us! Wishing you the very best for your preparations -- Hope to see you on PrepInsta Prime too 💚
Feel free to reach out to us over Instagram: www.prepinsta.com/instagram/
Or drop a message on bit.ly/primeWA
Or call us on 8448440710. Our mentors would be very glad to help you out with your queries and placement.
Team PrepInsta is always here to help!
Do they allow coding in Python or only c/c++? Please reply
Yes
Ia JavaScript allowed
No, you can do coding in C, C++, Java, python ;)
is this really Accenture question?
Hi💖
Yes, some are Accenture previous year questions whereas on others we have followed the patter.😊
Bro tomorrow My Accenture exam can you help me for exam
Hello, where did you give your exam? At home or at centre? Actually I have no idea about this. Can I give the exam from home or i have to go to centre? And the mock assessment is taken at home or at centre? Because i have to make necessary arrangements then. Please reply bro. 🙏
From home@@payelkumbhakar6337
@@payelkumbhakar6337 Home
Sir, your voice is not clear
Hey, thank you for informing us. We will take care of it from next time. 🙌
itna bhi easy nahi aane waala for sure
Hi, Here are PYQs you can refer to this link prepinsta.com/accenture-previous-papers/
If you need any help, kindly give us a call on 8448440710.
make me correct if their is any easy way
//Check Password
public class prg34 {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
String str=scan.nextLine();
int l=str.length();
int special=0;
int upper=0;
int lower=0;
int number=0;
for(int i=0;i='A'&&str.charAt(i)='a'&&str.charAt(i)=1&&upper>=1&&upper+lower>=4&&special>=1) {
System.out.println(0);
}else {
System.out.println(1);
}
}
}
code:2
def checkpassword(s,n):
if n
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int sum=0;
int n=sc.nextInt();
int a[]=new int[n];
for(int i=0;i=2)
sum+=odd.get(odd.size()-2);
System.out.print(sum);
}
}