1st Question : import java.util.Stack; class Solution{ public void greater(int[] arr){ int[] result = new int[arr.length]; Stackstack = new Stack(); for(int i=arr.length-1;i>=0;i--){ while(!stack.isEmpty() && stack.peek()
ye kya baat hai bhaiya ji ki agar time complexity n^2 hui to error aajayega?... ab mtlb kisi ne on the spot question solve kiya hai without optimisation to uska code chalega bhi nahi?
Brother, I have question, How many times we can submit a question , as in can we do like leetcode that if we submit question and it goes wrong then can we make changes in code and submit again??
Problem 2: import java.util.*; class HelloWorld { public static void main(String[] args) { int[] arr = {1,0,2,3,0,0,4,5,0}; int i = 0; int j = 0; int n = arr.length; for (int x: arr) System.out.print(x + " "); System.out.println(" "); while (j
What if I do this for the nearest int question.. while(true) { if(neg%m==0) { System.out.println("Nearest Integer:"+neg); break; } if(pos%m==0) { System.out.println("Nearest Integer:"+pos); break; } neg--; pos++; }
@@arkodipdas3697 suppose the number be -7 and divisor be 3...answer should have been -6 but your algorithm produces -9 as thr answer...you have to check the difference between both multiples and the multiple giving us the lower difference is the answer
import java.util.*; public class accenture26slot { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter the number of elements:"); int n = sc.nextInt(); int[] arr = new int[n]; System.out.println("Enter the elements:"); for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } System.out.println("Input Array: " + Arrays.toString(arr)); int[] result = nextGreaterNum(arr, n); System.out.println("Output Array: " + Arrays.toString(result)); } static int[] nextGreaterNum(int[] arr, int n) { int[] result = new int[n]; for (int i = 0; i < n; i++) { int next = -1; for (int j = i + 1; j < n; j++) { if (arr[i] < arr[j]) { next = arr[j]; break; } } result[i] = next; } return result; } } 1 st question ans
✅✅Join Our Telegram Group for Accenture 2025 Batch Discussion : t.me/placement_batch_2025
✅✅Important IT Interview Subject Notes: topmate.io/code_bashers/1026390
✅✅Book Mock Interview : topmate.io/code_bashers
sir can u also provide Qs link, so that we can also submit solutions for our practice. BTW great Explanation😍
thanks for making so much effort and providing quality problems
1st Question :
import java.util.Stack;
class Solution{
public void greater(int[] arr){
int[] result = new int[arr.length];
Stackstack = new Stack();
for(int i=arr.length-1;i>=0;i--){
while(!stack.isEmpty() && stack.peek()
Problem 1:
import java.util.*;
class HelloWorld
{
public static void main(String[] args)
{
// int[] arr = {5,4,1,2,3};
// int[] arr = {5,4,3,2,1};
int[] arr = {5,4,2,3,1};
int n = arr.length;
int[] res = new int[n];
Stack stack = new Stack();
int i = n-1;
while (i>=0)
{
if (stack.isEmpty())
{
res[i] = -1;
stack.push(arr[i]);
}
else
{
if (arr[i] = stack.peek())
{
stack.pop();
}
if (stack.isEmpty())
{
res[i] = -1;
}
else
{
res[i] = stack.peek();
}
stack.push(arr[i]);
}
}
i--;
continue;
}
for (int x: res) System.out.print(x + " ");
}
}
Please can you post the Question Bank of coding questions.
59:00 does not give correct output for negative integer and if the difference is same
it's given that the num and m are positive
can you provide the quetion links that will help to practice the question I leetCode quetions
Please upload solutions in python please sir
Problem 2 :
def shiftzeros(arr):
count = 0
temp = []
for i in range(len(arr)):
if arr[i] == 0:
count += 1
continue
temp.append(arr[i])
temp += [0] * count
return temp
In nearest integer we can use binary search for this question
ECE-branch, Mrec, 27th of August
???
pls include the solutions in python
🍌
Python 😂
Convert it.
I got assessment link in my email yesterday. What can i do now ?? In how many days can i give this assessment.
Contact me at t.me/cdb15
Bro pls provide code in python
ye kya baat hai bhaiya ji ki agar time complexity n^2 hui to error aajayega?... ab mtlb kisi ne on the spot question solve kiya hai without optimisation to uska code chalega bhi nahi?
Yhi baat hai bhai , kya krein 😅😅
Accenture off campus 2025 apply suru hoye geche?
Brother, I have question, How many times we can submit a question , as in can we do like leetcode that if we submit question and it goes wrong then can we make changes in code and submit again??
@CodeBashers Plz reply
Is this much toughness present in the exam ??
sir can you plz provide code in python
Are you from bharati vidyapeeth
are these accenture on campus or off campus questions?
Problem 2:
import java.util.*;
class HelloWorld
{
public static void main(String[] args)
{
int[] arr = {1,0,2,3,0,0,4,5,0};
int i = 0;
int j = 0;
int n = arr.length;
for (int x: arr) System.out.print(x + " ");
System.out.println(" ");
while (j
What if I do this for the nearest int question..
while(true)
{
if(neg%m==0)
{
System.out.println("Nearest Integer:"+neg);
break;
}
if(pos%m==0)
{
System.out.println("Nearest Integer:"+pos);
break;
}
neg--;
pos++;
}
@@arkodipdas3697 suppose the number be -7 and divisor be 3...answer should have been -6 but your algorithm produces -9 as thr answer...you have to check the difference between both multiples and the multiple giving us the lower difference is the answer
@@arkodipdas3697 btw what is neg and pos?
@@SayanKarmakar Nah buddy its showing me the right answer.
problem 2
#include
#include
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n];
vector v;
int c=0;
for(int i=0; i>arr[i];
}
for(int i=0; i
we should do it in_place
Is these questions for 6.5 lpa?
import java.util.*;
public class accenture26slot {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of elements:");
int n = sc.nextInt();
int[] arr = new int[n];
System.out.println("Enter the elements:");
for (int i = 0; i < n; i++) {
arr[i] = sc.nextInt();
}
System.out.println("Input Array: " + Arrays.toString(arr));
int[] result = nextGreaterNum(arr, n);
System.out.println("Output Array: " + Arrays.toString(result));
}
static int[] nextGreaterNum(int[] arr, int n) {
int[] result = new int[n];
for (int i = 0; i < n; i++) {
int next = -1;
for (int j = i + 1; j < n; j++) {
if (arr[i] < arr[j]) {
next = arr[j];
break;
}
}
result[i] = next;
}
return result;
}
}
1 st question ans