Ice Cream Parlor | HackerRank | Python | Searching | Part-1 | Python Programming | Coding

Published: 10 August 2021
on channel: Coding Cart
1,527
28

This video is about "Ice Cream Parlor" problem from HackerRank under section Searching.
Problem:
Easy:
https://www.hackerrank.com/challenges...
https://www.hackerrank.com/challenges...
Code1:
def icecreamParlor(m, arr):
Write your code here
res=[]
for i in range(len(arr)):
x=m-arr[i]
if x in arr[i+1:]:
res.append(i+1)
res.append(len(arr[0:i+1])+arr[i+1:].index(x)+1)
return res
Code2:
def icecreamParlor(m, arr):
Write your code here
dic = dict()
for i in range(len(arr)):
if arr[i] in dic:
return dic[arr[i]]+1, i+1
else:
dic[m-arr[i]] = i

Medium:https://www.hackerrank.com/challenges...
Code for above Medium Problem:
def whatFlavors(arr, m):
Write your code here
dic = dict()
for i in range(len(arr)):
if arr[i] in dic:
print( dic[arr[i]]+1, i+1)
break
else:
dic[m-arr[i]] = i


Follow us on:
Whatsapp:
https://chat.whatsapp.com/LNwHGukUizj...
Telegram:
https://t.me/joinchat/QJvaJ97Xuut6i_Zm

For 1 : 1 Tutoring
WhatsApp contact : 7278222619
mail: jaiswalsatya93@gmail.com

You can support via UPI : sattujaiswal@okhdfcbank


Facebook:
  / 779620502848988  
  / codingcart  

Linkedin:
  / satyendra-jaiswal-903588a2  
  / codingcart  

Instagram:
  / codingcart  

#HackerRank #IceCreamParlor #Searching #Python


On this page of the site you can watch the video online Ice Cream Parlor | HackerRank | Python | Searching | Part-1 | Python Programming | Coding with a duration of hours minute second in good quality, which was uploaded by the user Coding Cart 10 August 2021, share the link with friends and acquaintances, this video has already been watched 1,527 times on youtube and it was liked by 28 viewers. Enjoy your viewing!