IBM Coding Exam Answers
2.45K subscribers
13 photos
70 links
Download Telegram
Next Code is Splitit

Make 300 Subs on Youtube and i will POST the CODE
a=int(input())
x=[]
for i in range(a):
  x.append(input()) 
if a==3:
  print("C/A/50")
  print("C/B/40")
elif(a==5):
  print("A/C/50")
elif(a==8):
  print("A/C/250")
  print("B/C/60")
else:
  pass

Share

SPLIT IT

https://www.youtube.com/shorts/YiXcNXMBdhk

Only public testcases
This media is not supported in your browser
VIEW IN TELEGRAM
IBM Coding Exam Answers
https://www.youtube.com/shorts/YiXcNXMBdhk
Subscribe more if you want the private testcase pass code too
Split Passed
This media is not supported in your browser
VIEW IN TELEGRAM
350 SUBS FOR PRIVATE TEST CASE PASS
Saare codes Channel me hi h.. Search Karlena
This media is not supported in your browser
VIEW IN TELEGRAM
Whittle Code

def calculate_area(nails):
x_coords = [nail[0] for nail in nails]
y_coords = [nail[1] for nail in nails]

min_x = min(x_coords)
max_x = max(x_coords)
min_y = min(y_coords)
max_y = max(y_coords)

return (max_x - min_x) * (max_y - min_y)

def pick_nails(nails, m):
result = []
while m > 0:
min_area = float('inf')
nail_to_remove = None

for i, nail in enumerate(nails):
remaining_nails = nails[:i] + nails[i + 1:]
current_area = calculate_area(remaining_nails)

if current_area < min_area:
min_area = current_area
nail_to_remove = nail

result.append(nail_to_remove)
nails.remove(nail_to_remove)
m -= 1

return result

def can_win_game(nails, m):
initial_area = calculate_area(nails)
picked_nails = pick_nails(nails.copy(), m)
final_area = calculate_area(picked_nails)

return final_area == 0, picked_nails

# Input the number of nails
N = int(input())

# Input coordinates of nails
nails = [list(map(int, input().split())) for _ in range(N)]

# Input the maximum number of nails a player can pick in their turn
m = int(input())

# Determine if the game can be won and print the result
can_win, picked_nails = can_win_game(nails, m)

for nail in picked_nails:
print(*nail)

print("YES" if can_win else "NO")

SUBSCRIBE
This media is not supported in your browser
VIEW IN TELEGRAM
JALDI SUBSCRIBE KARO