int res=X*1 + Y*2 + Z*3;
int count=0;
for(int i=0;i<A.size();i++){
if(A.get(i)<=res){
count++;
}
}
return count;
For John Code
Telegram - https://t.me/Coding_solution_0
int count=0;
for(int i=0;i<A.size();i++){
if(A.get(i)<=res){
count++;
}
}
return count;
For John Code
Telegram - https://t.me/Coding_solution_0
n=int(input())
x=int(input())
y=int(input())
z=int(input())
a=[]
for i in range(n):
a.append(int(input()))
s=(x*1)+(y*2)+(z*3)
c=0
for i in a:
if i<=s:
c+=1
print(c)
Python
John Code
Telegram
https://t.me/Coding_solution_0
x=int(input())
y=int(input())
z=int(input())
a=[]
for i in range(n):
a.append(int(input()))
s=(x*1)+(y*2)+(z*3)
c=0
for i in a:
if i<=s:
c+=1
print(c)
Python
John Code
Telegram
https://t.me/Coding_solution_0
def check(a,n)
if n==1:
return 1
a.sort()
c=0
i=0
while(i<n-1):
if a[i+1]-a[i]==1:
i=i+2
c=c+1
else:
i=i+1
if c:
return c
else:
return 1
n=int(input())
a=[]
for i in range(n):
a.append(int(input()))
print(check(a,n))
Python
Whales code
Telegram- https://t.me/Coding_solution_0
if n==1:
return 1
a.sort()
c=0
i=0
while(i<n-1):
if a[i+1]-a[i]==1:
i=i+2
c=c+1
else:
i=i+1
if c:
return c
else:
return 1
n=int(input())
a=[]
for i in range(n):
a.append(int(input()))
print(check(a,n))
Python
Whales code
Telegram- https://t.me/Coding_solution_0
Forwarded from Off Campus Job Update
Forwarded from Coding Solutions Group
Please open Telegram to view this post
VIEW IN TELEGRAM
n = int(input())
a = list(map(int,input().split()))
c = 0
for i in range(n-1):
for j in range(i+1:n):
s1 = sum(list(map(int,bin(i)[2:].split())))
s2 = sum(list(map(int,bin(j)[2:].split())))
if s1 == s2:
c += 1
print(c)
Python
Bob and Numbers Code
Telegram- https://t.me/Coding_solution_0
a = list(map(int,input().split()))
c = 0
for i in range(n-1):
for j in range(i+1:n):
s1 = sum(list(map(int,bin(i)[2:].split())))
s2 = sum(list(map(int,bin(j)[2:].split())))
if s1 == s2:
c += 1
print(c)
Python
Bob and Numbers Code
Telegram- https://t.me/Coding_solution_0
https://t.me/Coding_solution_0
n = int(input())
a = list(map(int,input().split()))
c = 0
for i in range(n-1):
for j in range(i+1:n):
s1 = sum(list(map(int,bin(i)[2:].split())))
s2 = sum(list(map(int,bin(j)[2:].split())))
if s1 == s2:
c += 1
print(c)
Python
Bob and Numbers Code
Telegram- https://t.me/Coding_solution_0
n = int(input())
a = list(map(int,input().split()))
c = 0
for i in range(n-1):
for j in range(i+1:n):
s1 = sum(list(map(int,bin(i)[2:].split())))
s2 = sum(list(map(int,bin(j)[2:].split())))
if s1 == s2:
c += 1
print(c)
Python
Bob and Numbers Code
Telegram- https://t.me/Coding_solution_0
Python
Rooted tree with N nodes code
An array A of N integer code
Bob received n job invitations code
Telegram -
https://t.me/Coding_solution_0
Rooted tree with N nodes code
An array A of N integer code
Bob received n job invitations code
Telegram -
https://t.me/Coding_solution_0
n=int(input())
m=int(input())
s=input()
t=input()
def subString(s,n):
c=0
for i in range(n):
for len in range(i+1,n+1):
a=s[i: len]
c+=1
return c-2
if s==t:
print(1)
else:
if t in s:
print(subString(s,n))
else:
print(0)
Python
Telegram -
https://t.me/Coding_solution_0
m=int(input())
s=input()
t=input()
def subString(s,n):
c=0
for i in range(n):
for len in range(i+1,n+1):
a=s[i: len]
c+=1
return c-2
if s==t:
print(1)
else:
if t in s:
print(subString(s,n))
else:
print(0)
Python
Telegram -
https://t.me/Coding_solution_0
Java
Maximum possibility of unique digits in k divided subarrray of given arraylist
Telegram - https://t.me/Coding_solution_0
Maximum possibility of unique digits in k divided subarrray of given arraylist
Telegram - https://t.me/Coding_solution_0
Rooted tree with N nodes code
An array A of N integer code
Bob received n job invitations code
Telegram-
https://t.me/Coding_solution_0
An array A of N integer code
Bob received n job invitations code
Telegram-
https://t.me/Coding_solution_0