YOUTUBE PR 100 SUBS KRDO BS.. I WILL UPLOAD Pick up service ✅
https://www.youtube.com/shorts/xcmj7hifWro
JALDI KARO
https://www.youtube.com/shorts/xcmj7hifWro
JALDI KARO
👍5
import math
def calculate_distance(point1, point2):
return abs(point1[0] - point2[0]) + abs(point1[1] - point2[1])
def assign_vehicles(passengers, vehicles):
allocated_vehicles = {}
total_distance = 0
for passenger in sorted(passengers):
min_distance = math.inf
closest_vehicle = ""
passenger_coordinates = passengers[passenger]
for vehicle in vehicles:
if vehicles[vehicle] == "":
vehicle_coordinates = vehicles[vehicle + "_coordinates"]
distance = calculate_distance(passenger_coordinates, vehicle_coordinates)
if distance < min_distance or (distance == min_distance and vehicle < closest_vehicle):
min_distance = distance
closest_vehicle = vehicle
allocated_vehicles[passenger] = closest_vehicle
vehicles[closest_vehicle] = passenger
total_distance += min_distance
return total_distance
N, M = map(int, input().split())
passengers = {}
vehicles = {}
for _ in range(N):
name, x, y = input().split()
passengers[name] = (int(x), int(y))
for _ in range(M):
vehicle, x, y = input().split()
vehicles[vehicle] = ""
vehicles[vehicle + "_coordinates"] = (int(x), int(y))
minimum_distance = assign_vehicles(passengers, vehicles)
print(minimum_distance,end="")
Solo rider✅ Public PRIVATE passed ✅✅✅... python 3
def calculate_distance(point1, point2):
return abs(point1[0] - point2[0]) + abs(point1[1] - point2[1])
def assign_vehicles(passengers, vehicles):
allocated_vehicles = {}
total_distance = 0
for passenger in sorted(passengers):
min_distance = math.inf
closest_vehicle = ""
passenger_coordinates = passengers[passenger]
for vehicle in vehicles:
if vehicles[vehicle] == "":
vehicle_coordinates = vehicles[vehicle + "_coordinates"]
distance = calculate_distance(passenger_coordinates, vehicle_coordinates)
if distance < min_distance or (distance == min_distance and vehicle < closest_vehicle):
min_distance = distance
closest_vehicle = vehicle
allocated_vehicles[passenger] = closest_vehicle
vehicles[closest_vehicle] = passenger
total_distance += min_distance
return total_distance
N, M = map(int, input().split())
passengers = {}
vehicles = {}
for _ in range(N):
name, x, y = input().split()
passengers[name] = (int(x), int(y))
for _ in range(M):
vehicle, x, y = input().split()
vehicles[vehicle] = ""
vehicles[vehicle + "_coordinates"] = (int(x), int(y))
minimum_distance = assign_vehicles(passengers, vehicles)
print(minimum_distance,end="")
Solo rider✅ Public PRIVATE passed ✅✅✅... python 3
👍13❤3🔥1
I am not asking money 💰💰
We want you to share the Channel to everyone
Then I will share all correct 💯 code very soon
Share @TCS_Codevita_Exam_Help
Share ✅ share✅ share✅
We want you to share the Channel to everyone
Then I will share all correct 💯 code very soon
Share @TCS_Codevita_Exam_Help
Share ✅ share✅ share✅
👍14❤2
IBM Coding Exam Answers
I am not asking money 💰💰 We want you to share the Channel to everyone Then I will share all correct 💯 code very soon Share @TCS_Codevita_Exam_Help Share ✅ share✅ share✅
SHARE KARO DUSRE GROUP ME YE LINK. LOGO KO ADD KARO YRR
👍2
There are few bugs in Pickup Service.. so it may only work for public test case
👍5🤩1
I AM NOT ASKING FOR MONEY.. I JUST WANT YOU ALL TO SUBSCRIBE.. PLEASE DO IT
https://www.youtube.com/shorts/YiXcNXMBdhk
https://www.youtube.com/shorts/YiXcNXMBdhk
👍2
Password Generator Code
def generate_password(number, name):
if name.isalpha() and name.islower():
abs_number = abs(number)
name_length = min(max(len(name), 1), 10)
password = str(abs_number) + name[:name_length]
return password
else:
return "Invalid"
T = int(input())
for
in range(T):
test_input = input().split()
number = int(test_input[e])
name = test_input[1]
result = generate_password(number, name)
print(result, end="")
def generate_password(number, name):
if name.isalpha() and name.islower():
abs_number = abs(number)
name_length = min(max(len(name), 1), 10)
password = str(abs_number) + name[:name_length]
return password
else:
return "Invalid"
T = int(input())
for
in range(T):
test_input = input().split()
number = int(test_input[e])
name = test_input[1]
result = generate_password(number, name)
print(result, end="")
🤯11👍5
Why NO ONE IS SUBSCRIBING? I WILL GIVE YOU CORRECT CODE ONLY AFTER THE CHANNEL REACH 200 SUBS
👍2
ATTENTION! I HAVE
Pick up service ✅
Splitit ✅
Whittle game ✅
https://www.youtube.com/shorts/YiXcNXMBdhk
I WILL SHARE ALL 3 after 20 minutes.. But you have to Subscribe the Youtube Channel..
I want all of you to subscribe
Pick up service ✅
Splitit ✅
Whittle game ✅
https://www.youtube.com/shorts/YiXcNXMBdhk
I WILL SHARE ALL 3 after 20 minutes.. But you have to Subscribe the Youtube Channel..
I want all of you to subscribe
👍5
👍3