pro100Istomin1988
BAN USER
Comments (5)
Reputation -5
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
-1
of 1 vote
python code
pairs=[(1,4),(6,8),(2,4),(7,9),(10,15)]
hours = 0
for i in pairs:
hours +=i[1]-i[0]
print(hours)
Comment hidden because of low score. Click to expand.
0
of 0 vote
python solution
def words_invert(s='the boy ran'):
l = s.split(' ')
r = []
for i in l:
r.append(i[::-1])
print(' '.join(r))
Comment hidden because of low score. Click to expand.
0
of 0 vote
python
def is_k_palindrome(s, k):
if 0<=k<=30 and len(s) <= 20000:
for i in range(len(s)):
sub_s = s[:i] + s[i+k:]
if sub_s == sub_s[::-1]:
print('yes')
print(sub_s)
else:
print('no')
print(sub_s)
Comment hidden because of low score. Click to expand.
0
of 0 vote
Python solution
def get_max(l = [11,30,2,30,30,30,6,2,62]):
rand = random.randint(0, len(l))
max_integer = (max(l[:rand]))
indexes=[]
for i in range(rand):
if l[i] == max_integer:
indexes.append(i)
print(rand)
print(max_integer)
print(indexes)
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
python solution
- pro100Istomin1988 April 05, 2019