python: def check(n): while(n!=0): if(n%10==1 or n%10==4 or n%10==9): n=n//10 else: return False return True m,n=map(int,input().split()) c=0 for i in range(m,n+1): if(check(i)): c+=1 print(c)
Please upload more questions on coding and other sections, this is really very helpful. This is literally the only channel having proper company sepcific prep playlists. Thank you!
2nd solution is incorrect, what if test case is 8, 5, and 10. The code fails for this test case, your code should be in loop while(a !=m){ if(a>m){ a +=a-m; rs =rs- a-m; } else{ a -=a-m; rs = rs + a-m; } } return rs;
I think question 1 solution needs to be modify because when we take m=0 and n=100 then for the value 0, while condition is false still flag==1 then count increases by 1.
Q1 in cpp #include #include using namespace std; int main() { int n = 200, m = 100; int count = 0; vector a; for (int i = m; i n) { count = -1; } else { for (int i = 0; i < a.size(); i++) { int ones = a[i] % 10; int tenth = (a[i] / 10) % 10; int hundredth = (a[i] / 100) % 10;
Java Code for first Problem: class HelloWorld { public static void main(String[] args) { int m=100; int n=200; boolean flag = false; int temp=0; int count=0; for(int i=m; i0){ if(temp%10==1||temp%10==4||temp%10==9){ flag=true; temp/=10; }else{ flag=false; break; } } if(flag){ System.out.println(i); count++; } } System.out.println(count); } }
python:
def check(n):
while(n!=0):
if(n%10==1 or n%10==4 or n%10==9):
n=n//10
else:
return False
return True
m,n=map(int,input().split())
c=0
for i in range(m,n+1):
if(check(i)):
c+=1
print(c)
Please upload more questions on coding and other sections, this is really very helpful. This is literally the only channel having proper company sepcific prep playlists. Thank you!
problem 2:
def A(a,m,rs):
if(a>m):
x=a-m
print(rs-x)
if(a
Thank you sir for the contents... Make more videos of previous year questions
do we such easy questions!!
are both the coding questions likes this in exam?
Thank you sir
I have done both questions through python and I hope u will keep uploading such questions.
I have done both the coding questions on my own. Thank you talent battle team for your valuable explanations
That's great..best of luck🤩
Which was the coding platform given?
PROBLEM - 2 In PYTHON
def BalanceFruits(a,m,rs):
if a>m:
rs=rs-(a-m)
elif m>a:
rs=rs+(m-a)
elif a==m:
rs=rs
return rs
b=BalanceFruits(8,4,6)
print(b)
2nd solution is incorrect, what if test case is 8, 5, and 10. The code fails for this test case, your code should be in loop
while(a !=m){
if(a>m){
a +=a-m;
rs =rs- a-m;
}
else{
a -=a-m;
rs = rs + a-m;
}
}
return rs;
I think question 1 solution needs to be modify because when we take m=0 and n=100 then for the value 0, while condition is false still flag==1 then count increases by 1.
good observation
this questions were asked in on campus or off campus..????
Thank you so much for the lecture sir.....I was able to solve the second quesition on my own pls provide more coding quesitions thanks a lot sir...
Is there coding round for package application Development associate
Awesome explanation
Can you explain why 100 is not included in the first program??
Since all the digits in a number has to be one of the three (1,4 and 9)
Thanq 😊
Sir which type of 1&2 program .c or c++?
C++
coding round is in salesforce ? or not
Python Code:
-------------------------------------------------------------------------
Problem 1:
def check(n):
while(n!=0):
if(n%10==1 or n%10==4 or n%10==9):
n=n//10
else:
return False
return True
def sol(m, n):
lst = []
count = 0
for i in range(m, n + 1):
if check(i):
lst.append(i)
count += 1
print(count)
return lst
print(sol(1, 20))
------------------------------------------------------------------------
Problem 2:
def BalanceFruits(a,m,rs):
if a>m:
rs=rs-(a-m)
elif m>a:
rs=rs+(m-a)
elif a==m:
rs=rs
return rs
print(BalanceFruits(4,8,6))
Can we write the code in javascript?
in accenture is it compulsory to write code in c/C++ only?
No.. you can choose the language you are comfortable with.
can anybody code in java...
for these questions
If we solved 1 coding Question and passed 1 test case if i will selected to further round
Can't say that, it depends on the number of candidates who apply and their performance, and the number of candidates the company wants to select.
Is accenture announced for 2022 batch
On campus
Can I Use Python For Solving this Or else I have to go with C?
c,cpp,java,python,Dot Net you can use any one of these for accenture
@@PreparewithTalentBattle Can You Please Upload Videos using Python 🙏
@@jagan6930 yes
Logic remain the same it's just the syntax difference
@@PreparewithTalentBattle can I use javascript
These questions are of very easy level, will this be the same level of questions? Or can wee expect questions from DP , Backtracking etc?
4.5lpa me helicopter banaoge ka be... Paglet ho ka bilkl
These are actual exam questions of last year
@@PreparewithTalentBattle Thanks a lot,
There are offering two roles 4.5 lpa & 6.5 lpa
will these roles have different exam or same exam?
Same exam
@@arjunpandey8767 are bhai bhai bhai!! haha
Q1 in cpp
#include
#include
using namespace std;
int main() {
int n = 200, m = 100;
int count = 0;
vector a;
for (int i = m; i n) {
count = -1;
} else {
for (int i = 0; i < a.size(); i++) {
int ones = a[i] % 10;
int tenth = (a[i] / 10) % 10;
int hundredth = (a[i] / 100) % 10;
if ((ones == 1 || ones == 4 || ones == 9) &&
(tenth == 1 || tenth == 4 || tenth == 9) &&
(hundredth == 1 || hundredth == 4 || hundredth == 9)) {
count++;
}
}
}
cout
Java Code for first Problem:
class HelloWorld {
public static void main(String[] args) {
int m=100;
int n=200;
boolean flag = false;
int temp=0;
int count=0;
for(int i=m; i0){
if(temp%10==1||temp%10==4||temp%10==9){
flag=true;
temp/=10;
}else{
flag=false;
break;
}
}
if(flag){
System.out.println(i);
count++;
}
}
System.out.println(count);
}
}
this questions were asked in on campus or off campus..????