IBM Coding Exam Answers
2.45K subscribers
13 photos
70 links
Download Telegram
100 SUBS DONE.. which new code you want?
Decide fast
This media is not supported in your browser
VIEW IN TELEGRAM
Fencing Code
C++
TCS Codevita

https://t.me/TCS_Codevita_Exam_Help

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int x, y, x1, y1, x2, y2;
    cin >> x >> y >> x1 >> y1 >> x2 >> y2;
   
    x = abs(x);
    y = abs(y);
    x1 = abs(x1);
    y1 = abs(y1);
    x2 = abs(x2);
    y2 = abs(y2);
   
    int r1 = sqrt(((x1 - x) * (x1 - x)) + ((y1 - y) * (y1 - y)));
    int r2 = sqrt(((x2 - x) * (x2 - x)) + ((y2 - y) * (y2 - y)));
   
    int a1 = M_PI * r1 * r1;
    int a2 = M_PI * r2 * r2;
   
    if (a2 > a1)
    {
        int e = a2 - a1;
        int f = sqrt(e);
        int g = f * f;
        int h = g - e;
        int i = h * 20;
        cout << "Krishna " << i;
    }
    else if (a1 > a2)
    {
        int p = a1 - a2;
        int q = p * 20;
        cout << "Shiva " << q;
    }
    else if (a1 == a2)
    {
        cout << "-1";
    }

    return 0;
}

Fencing Code
C++
TCS Codevita

https://t.me/TCS_Codevita_Exam_Help
This media is not supported in your browser
VIEW IN TELEGRAM
SUBSCRIBE MORE.... SHARE THIS CHANNEL
I have... Bubble Sort, Password Generator and Captcha Code
#include<bits/stdc++.h>
using namespace std;

int main()
{
int x, y, x1, y1, x2, y2;
cin >> x >> y >> x1 >> y1 >> x2 >> y2;

x = abs(x);
y = abs(y);
x1 = abs(x1);
y1 = abs(y1);
x2 = abs(x2);
y2 = abs(y2);

int r1 = sqrt(((x1 - x) * (x1 - x)) + ((y1 - y) * (y1 - y)));
int r2 = sqrt(((x2 - x) * (x2 - x)) + ((y2 - y) * (y2 - y)));

int a1 = M_PI * r1 * r1;
int a2 = M_PI * r2 * r2;

if (a2 > a1)
{
int e = a2 - a1;
int f = sqrt(e);
int g = f * f;
int h = g - e;
int i = h * 20;
cout << "Krishna " << i;
}
else if (a1 > a2)
{
int p = a1 - a2;
int q = p * 20;
cout << "Shiva " << q;
}
else if (a1 == a2)
{
cout << "-1";
}

return 0;
}

Fencing Problem

Pls share

https://t.me/TCS_Codevita_Exam_Help
This media is not supported in your browser
VIEW IN TELEGRAM
Sports Day
Pytho
n
TCS Codevita


def ans(numbers):
numbers.sort()
n = len(numbers)
placementlelo = 0

for i in range(n):
efficiency = 0
priority = 1

for j in range(i, n):
efficiency += numbers[j] * priority
priority += 1

if efficiency > placementlelo:
placementlelo = efficiency

return placementlelo

numbers = list(map(int, input().split()))

result = ans(numbers)
if(result>0):
print(result, end="")
else:
print(0, end="")

Sports Day
Pytho
n
TCS Codevita


Pls share

https://t.me/TCS_Codevita_Exam_Help
This media is not supported in your browser
VIEW IN TELEGRAM
SUBSCRIBE MORE.... SHARE THIS CHANNEL

NEXT UPCOMING CODES:

BUBBLE SORT

Password Generator
Also For Discussion.. You can Join: @Codeing_Are
MAKE THE SUSBCRIBERS 500 and..

Don't Panic Everyone! Just Calm Down.. You have 6 Hours to complete those 6 Questions

Every Code will be uploaded.. But you have to share this Channel

SHARE THIS CHANNEL
This media is not supported in your browser
VIEW IN TELEGRAM
def minimum_vehicles(weights, max_limit):
# Filter out zero weights and sort the remaining weights in descending order
sorted_weights = sorted(filter(lambda x: x != 0, weights), reverse=True)

left, right = 0, len(sorted_weights) - 1
vehicles = 0

while left <= right:
if sorted_weights[left] + sorted_weights[right] <= max_limit:
right -= 1
left += 1
vehicles += 1

return vehicles

# Example usage:
weights = list(map(int, input().split()))
max_limit = int(input())

result = minimum_vehicles(weights, max_limit)
print(result,end="")

WareHouse Problem
Pytho
n
TCS Codevita


Pls share

https://t.me/TCS_Codevita_Exam_Help
This media is not supported in your browser
VIEW IN TELEGRAM
SUBSCRIBE...if you want Bubble Sort