TCS Innovator Elevate Wings 1 Questions & Answers 2024 (Solved), Check TCS Innovator Elevate Wings 1 Python Questions

TCS Innovator Elevate Wings 1 Questions & Answers 2024 | TCS Innovator Elevate Wings 1 Python Questions | TCS Innovator Elevate Wings 1 Java Questions | TCS Innovator Elevate Wings 1 C++ Questions | TCS Innovator Elevate Wings 1 Previous Year Questions

TCS Innovator Elevate Wings 1 Questions & Answers 2024: The coding test is medium complexity, meaning that while passing it is not impossible, it is also not very simple. If you practiced some of the code questions from the previous year’s examination, you would undoubtedly have an advantage in the upcoming TCS Innovator Elevate Wings 1 exam. Let’s look at a few test patterns, TCS Innovator Elevate Wings 1 Java Questions and Answers/ TCS Innovator Elevate Wings 1 Questions in Python, C, C++, Java, and Python code problems and their fixes. In the below section, you can find the TCS Innovator Elevate Wings 1 Exam Questions and Answers/TCS Innovator Elevate Wings 1 Coding Questions & Answers 2023

Previous recruiting campaigns’ coding examinations placed a strong focus on arrays and other fundamental programming principles. One can easily pass the first round and even the ones after that if they prepare adequately. You must select a language that you are comfortable with, such as C, C++, Java, or even Python, in order to complete the coding tasks. More details like TCS Innovator Elevate Wings 1 Questions and Answers, TCS Innovator Elevate Wings Coding Questions & Answers, TCS Innovator Elevate Wings 1 Python Coding Questions & Answers, etc. available on its website

TCS Innovator Elevate Wings 1 Questions With Solutions 2024

Constellation Problem

Three characters { #, *, . } represents a constellation of stars and galaxies in space. Each galaxy is demarcated by # characters. There can be one or many stars in a given galaxy. Stars can only be in the shape of vowels { A, E, I, O, U }. A collection of * in the shape of the vowels is a star. A star is contained in a 3×3 block. Stars cannot be overlapping. The dot(.) character denotes empty space.

Given 3xN matrix comprising of { #, *, . } character, find the galaxy and stars within them.

Note: Please pay attention to how vowel A is denoted in a 3×3 block in the examples section below.

Constraints

  • 3 <= N <= 10^5

Input

  • Input consists of a single integer N denoting the number of columns.

Output

  • The output contains vowels (stars) in order of their occurrence within the given galaxy. The galaxy itself is represented by the # character.

Example 1

Input

18

* . * # * * * # * * * # * * * . * .

* . * # * . * # . * . # * * * * * *

* * * # * * * # * * * # * * * * . *

Output

U#O#I#EA

Explanation

As it can be seen that the stars make the image of the alphabets U, O, I, E, and A respectively.

Example 2

Input

12

* . * # . * * * # . * .

* . * # . . * . # * * *

* * * # . * * * # * . *

Output

U#I#A

Explanation

As it can be seen that the stars make the image of the alphabet U, I, and A.

Possible solution:

Input:

12

* . * # . * * * # . * .

* . * # . . * . # * * *

* * * # . * * * # * . *

C++ PROGRAM

#include<bits/stdc++.h>
using namespace std;
 
int main()
{
    int n;cin>>n;
    char co[3][n];
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<n;j++)
        cin>>co[i][j];
    }
    for(int i=0;i<n-2;i++)
    {
        if(co[0][i]=='#') {cout<<"#";continue;}
        if(co[0][i]=='.' && co[0][i+1]=='*' && co[0][i+2]=='.')
        {
            if(co[1][i]=='*' && co[1][i+1]=='*' && co[1][i+2]=='*')
            if(co[2][i]=='*' and co[2][i+1]=='.' and co[2][i+2]=='*')
            cout<<"A";i+=2;continue;
        }
        if(co[0][i]=='*' and co[0][i+1]=='*' and co[0][i+2]=='*')
        {
            if (co[1][i]=='*' and co[1][i+1]=='*' and co[1][i+2]=='*')
            {
                if (co[2][i]=='*' and co[2][i+1]=='*' and co[2][i+2]=='*')
                {cout<<"E";i+=2;continue;}
            }
            else if(co[1][i]=='.' and co[1][i+1]=='*' and co[1][i+2]=='.')
            {
                 if (co[2][i]=='*' and co[2][i+1]=='*' and co[2][i+2]=='*')
                 {cout<<"I";i+=2;continue;}
            }
            else if(co[1][i]=='*' and co[1][i+1]=='.' and co[1][i+2]=='*')
            {
                if(co[2][i]=='*' and co[2][i+1]=='*' and co[2][i+2]=='*')
                {cout<<"O";i+=2;continue;}
            }
        }
        if(co[0][i]=='*' and co[0][i+1]=='.' and co[0][i+2]=='*')
        if(co[1][i]=='*' and co[1][i+1]=='.' and co[1][i+2]=='*')
        if(co[2][i]=='*' and co[2][i+1]=='*' and co[2][i+2]=='*')
        {cout<<"U";i+=2;continue;}
    }
}

PYTHON PROGRAM

n=int(input())
co=[]
for i in range(3):co.append(list(input().split()))
i=0
while i<n-2:
    if co[0][i]=='#':
        print("#",end="")
        i+=1
        continue
    if co[0][i]=='.' and co[0][i+1]=='*' and co[0][i+2]=='.':
        if co[1][i]=='*' and co[1][i+1]=='*' and co[1][i+2]=='*':
            if co[2][i]=='*' and co[2][i+1]=='.' and co[2][i+2]=='*':
                print('A',end="")
    if co[0][i]=='*' and co[0][i+1]=='*' and co[0][i+2]=='*':
        if co[1][i]=='*' and co[1][i+1]=='*' and co[1][i+2]=='*':
            if co[2][i]=='*' and co[2][i+1]=='*' and co[2][i+2]=='*':
                print('E',end="")
                i+=3
                continue
        elif co[1][i]=='.' and co[1][i+1]=='*' and co[1][i+2]=='.':
            if co[2][i]=='*' and co[2][i+1]=='*' and co[2][i+2]=='*':
                print('I',end="")
                i+=3
                continue
        elif co[1][i]=='*' and co[1][i+1]=='.' and co[1][i+2]=='*':
            if co[2][i]=='*' and co[2][i+1]=='*' and co[2][i+2]=='*':
                print('O',end="")
                i+=3
                continue
    if co[0][i]=='*' and co[0][i+1]=='.' and co[0][i+2]=='*':
        if co[1][i]=='*' and co[1][i+1]=='.' and co[1][i+2]=='*':
            if co[2][i]=='*' and co[2][i+1]=='*' and co[2][i+2]=='*':
                print('U',end="")
                i+=3
                continue
    i+=1

Polygon Coding Question 

Problem Description:

You are given N number of coordinates and you have to create a polygon from these points such that they will make a polygon with maximum area.

Note: coordinates provided in the input may or may not be in sequential form.

Constraints
1 <= N <= 10

Input:

First line contains an integer N which depicts number of co-ordinates

Next N lines consist of two space separated integer depicting coordinates of in form of xy

Output:
Print the maximum possible area possible by creating a polygon by joining the coordinates.

If the area is in decimal form, print the absolute value as output.

Time Limit (secs):
1

Examples:
Input:

4

0  0

2  0

0  2

2  2

Output:

4

Explanation:

As we can imagine these points will make a square shape and the maximum possible area made by the polygon will be 4.

C++ PROGRAM

#include<bits/stdc++.h>
using namespace std;
struct Point {
    int x, y;
};
// Comparator function to sort points based on x-coordinate (and y-coordinate in case of a tie)
bool comparePoints(const Point &a, const Point &b) {
    return (a.x < b.x) || (a.x == b.x && a.y < b.y);
}
// Cross product of vectors (p1-p0) and (p2-p0)
int crossProduct(const Point &p0, const Point &p1, const Point &p2) {
    int x1 = p1.x - p0.x;
    int y1 = p1.y - p0.y;
    int x2 = p2.x - p0.x;
    int y2 = p2.y - p0.y;
    return x1 * y2 - x2 * y1;
}
// Graham's Scan algorithm to find the convex hull
vector convexHull(vector &points) {
    int n = points.size();
    if (n <= 3) return points;
    // Sort the points based on x-coordinate (and y-coordinate in case of a tie)
    sort(points.begin(), points.end(), comparePoints);
    // Initialize the upper and lower hulls
    vector upperHull, lowerHull;
    // Build the upper hull
    for (int i = 0; i < n; i++) {
        while (upperHull.size() >= 2 && crossProduct(upperHull[upperHull.size() - 2], upperHull.back(), points[i]) <= 0) {
            upperHull.pop_back();
        }
        upperHull.push_back(points[i]);
    }
    // Build the lower hull
    for (int i = n - 1; i >= 0; i--) {
        while (lowerHull.size() >= 2 && crossProduct(lowerHull[lowerHull.size() - 2], lowerHull.back(), points[i]) <= 0) {
            lowerHull.pop_back();
        }
        lowerHull.push_back(points[i]);
    }
    // Combine the upper and lower hulls to get the convex hull
    upperHull.pop_back(); // Remove the last point to avoid duplication
    lowerHull.pop_back();
    upperHull.insert(upperHull.end(), lowerHull.begin(), lowerHull.end());
    return upperHull;
}
// Calculate the area of a polygon
double calculateArea(vector &polygon) {
    int n = polygon.size();
    if (n < 3) return 0.0; // Not a valid polygon
    double area = 0.0;
    for (int i = 0; i < n; i++) {
        int x1 = polygon[i].x;
        int y1 = polygon[i].y;
        int x2 = polygon[(i + 1) % n].x;
        int y2 = polygon[(i + 1) % n].y;
        area += (x1 * y2 - x2 * y1);
    }
    return abs(area) / 2.0;
}
int main() {
    int n;
    cin >> n;
    vector points(n);
    for (int i = 0; i < n; i++) {
        cin >> points[i].x >> points[i].y;
    }
    vector convexHullPoints = convexHull(points);
    double maxArea = calculateArea(convexHullPoints);
    cout << maxArea << endl;
    return 0;
}
JOB ALERT ON INSTAGRAM FOLLOW NOW>>
JOB ALERT ON YOUR EMAIL DAILY SUBSCRIBE NOW>>

Keep an eye on Dailyrecruitment.in for the most up-to-date information about upcoming exams and results. Find out about official notices, Exam Patterns, Syllabus, Previous Question Papers, Expected Cut Off, Results, Merit List, Study Materials, and much more. Now is the time to bookmark in order to take advantage of even more amazing career opportunities.

Govt Jobs by Qualifications

Education & Vacancies Salary Apply Link
10th Pass Govt Jobs - 5,000 Vacancies Rs. 5,200 - 63,200 Apply Now
12th Pass Govt Jobs - 18,000+ Vacancies Rs. 5,200 - 92,300 Apply Now
ITI Pass Jobs - 3,500 Vacancies Rs. 5,200 - 35,000 Apply Now
Any Graduate Jobs - 19,100 Vacancies Rs. 5,200 - 92,300 Apply Now
Central Govt Jobs Rs. 5,200 - 17,000 Apply Now
Bank Jobs - 1,000 Vacancies Rs. 5,200 - 29,200 Apply Now
Diploma Jobs - 9,300 Vacancies Rs. 5,200 - 35,000 Apply Now
BTech/BE Jobs - 18,000 Vacancies Rs. 15,000 - 1,00,000 Apply Now
Data Entry Jobs - 1,300 Vacancies Rs. 5,200 - 29,200 Apply Now
Private Jobs Rs. 10,000 - 67,700 Apply Now