Python Problem Asked in Google | Google Interview Questions | Python For Data Science

preview_player
Показать описание
In this video we will discuss one python problem asked in google for the role of data scientist.

Check our Data Science & Analytics Courses on our website. We provide hands-on practical learning experience to our learners with 1-1 Live Doubt Clearance Support over Skype Chat everyday. Also you will get projects and case studies that you can add in your resume.

➡️1. Data Science and Analytics Mega Combo Course (Offer Price - Rs.6999/-)

➡️2. Data Science Combo Course (Offer Price - Rs.3999/-)

➡️3. Data Analytics/ Business Analytics Combo Course (Offer Price - Rs.3990/-)

➡️4. For More Courses, check our Website Homepage.

Our Social Media Channels

Stay Safe and Keep Learning
- Team CloudyML

#python #pythonprogramming #pythontutorial #googleinterview
Рекомендации по теме
Комментарии
Автор

Join our Telegram Channel to get Data Science and Analytics Job Opening Updates, Interview QnAs, Blogs, Quizzes, Hand-Written Notes and QnA PDF, etc for FREE everyday. Follow the link below

CloudyML
Автор

def func(l_int):
count = 1
length = 0
for i in l_int:
for j in range(1, len(l_int)):
if i+j in l_int:
count += 1
else:
break
length = max(length, count)
count = 1

print(length)
func([100, 4, 200, 1, 3, 2])

poojahaldder
Автор

## first we need to sort the array
## starting with the second index, check if its 1 more than the previous and keep doing that until the logic fails
## replace the counter with next highest ct

def longestConsecutive(num):
longestStreak = 1
streak = 1
num.sort()
for i in range(1, len(num)):
if num[i] == num[i-1]+1:
streak = streak + 1
else:
if longestStreak < streak:
longestStreak = streak
streak = 0
return longestStreak

Ryanle
Автор

nums = [100, 4, 200, 1, 3, 2]
nums.sort()
stri = ""
x=0

for i in range(nums[0], nums[-1]+1):
if i in nums:
x = x + 1
else:
stri = stri + str(x)
x = 0
stri = stri + str(x)

max_seq = max(list(stri))
print("Max consecutive sequence is:", max_seq)

mihirshinde
join shbcf.ru