304 North Cardinal St.
Dorchester Center, MA 02124

# Utkarsh and Placement tests CodeChef Solution

## Utkarsh and Placement tests CodeChef Solution in C++17

``````#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
while(t--){
char a,b,c,x,y;
cin>>a>>b>>c>>x>>y;
if(a==x||a==y)
cout<<a<<endl;
else if(b==x||b==y)
cout<<b<<endl;
else
cout<<c<<endl;
}
return 0;
}
``````

## Utkarsh and Placement tests CodeChef Solution in C++14

``````#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
while(t--){
char a,b,c,x,y;
cin>>a>>b>>c>>x>>y;

if(x==a)
cout<<x<<endl;
else if(y==a)
cout<<y<<endl;
else if(x==b)
cout<<x<<endl;
else if(y==b)
cout<<y<<endl;
else if(x==c)
cout<<x<<endl;
else
cout<<y<<endl;
}

return 0;
}
``````

## Utkarsh and Placement tests CodeChef Solution in PYTH 3

``````# cook your dish here
t=int(input())
for i in range(t):
a=list(map(str,input().split()))
b=list(map(str,input().split()))
for j in range(3):
for k in range(2):
if a[j]==b[k]:
print(b[k])
break
if a[j]==b[k]:
break``````

## Utkarsh and Placement tests CodeChef Solution in C

``````#include <stdio.h>

int main(void) {
int t;
scanf("%d",&t);
while(t--)
{
char a,b,e;
scanf(" %c %c %c ",&a,&b,&e);

char c,d;
scanf(" %c %c ",&c,&d);
if(c==a||d==a)
printf("\n%c",a);
else if(c==b||d==b)
printf("\n%c",b);
else if(c==e||d==e)
printf("\n%c",e);
}
return 0;
}

``````

## Utkarsh and Placement tests CodeChef Solution in JAVA

``````/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
while(n-->0)
{
char[] ch=new char[3];
char[] ch1=new char[2];
for(int i=0;i<3;i++)
{
ch[i]=sc.next().charAt(0);
}
for(int i=0;i<2;i++)
{
ch1[i]=sc.next().charAt(0);
}
for(int i=0;i<3;i+=3)
{
for(int j=0;j<2;j+=2)
{
if(ch[i]==ch1[j])
{
System.out.println(ch1[j]);
}
else if(ch[i]==ch1[j+1])
{
System.out.println(ch1[j+1]);
}
else if(ch[i+1]==ch1[j])
{
System.out.println(ch1[j]);
}
else if(ch[i+1]==ch1[j+1])
{
System.out.println(ch1[j+1]);
}
else if(ch[i+2]==ch1[j])
{
System.out.println(ch1[j]);
}
else if(ch[i+2]==ch1[j+1])
{
System.out.println(ch1[j+1]);
}
}
}
}
}
}
``````

## Utkarsh and Placement tests CodeChef Solution in PYPY 3

``````t = int(input())
for _ in range(t):
f, s, t = input().split()
x, y = input().split()

pref = [f, s, t]
offers = [x, y]

for i in pref:
if i not in offers:
pref.remove(i)
print(pref[0])``````

## Utkarsh and Placement tests CodeChef Solution in PYTH

``````t = int(raw_input())
for i in range(t):
st = raw_input().split()
pst = raw_input().split()
found = False
p = 0
if st[p] in pst:
found = True
print st[p]
else:
p += 1
# endif
# endwhile
# endfor i

``````

## Utkarsh and Placement tests CodeChef Solution in C#

``````using System;

public class Test
{
public static void Main()
{
while(t-->0){
char first =  char.Parse(str[0]);
char second = char.Parse(str[1]);
char third = char.Parse(str[2]);
char x =  char.Parse(str1[0]);
char y = char.Parse(str1[1]);
if(x==first || y==first){
Console.WriteLine(first);
}
else if(x==second||y==second){
Console.WriteLine(second);
}
else{
Console.WriteLine(third);
}
}
}
}
``````

## Utkarsh and Placement tests CodeChef Solution in NODEJS

``````'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});

process.stdin.on('end', _ => {
inputString = inputString.replace(/\s*\$/, '')
.split('\n')
.map(str => str.replace(/\s*\$/, ''));

main();
});

return inputString[currentLine++];
}

function main() {

for( let i=0; i<tests; i++ ) {

console.log(findOfferAccepted( preferances, offers ));

}
}

function findOfferAccepted(preferances, offers) {
let set = new Set();

for( let i=0; i<offers.length; i++ ) {
}

for( let i=0; i<offers.length; i++ ) {
if( set.has(preferances[i]) ) return preferances[i];

}
}

``````

## Utkarsh and Placement tests CodeChef Solution in GO

``````package main

import (
"bufio"
"os"
"strconv"
)

var (
scanner *bufio.Scanner
writer  *bufio.Writer
)

func main() {
// setup
scanner = bufio.NewScanner(os.Stdin)
scanner.Split(bufio.ScanWords)
writer = bufio.NewWriter(os.Stdout)
pref := make([]rune, 3)
allot := make([]rune, 2)
for c := scanInt(); c > 0; c-- {
for i := 0; i < 3; i++ {
pref[i] = scanChar()
}
for i := 0; i < 2; i++ {
allot[i] = scanChar()
}
// could use hashmap but generally slower
if allot[0] == pref[0] {
writer.WriteRune(allot[0])
} else if allot[1] == pref[0] {
writer.WriteRune(allot[1])
} else if allot[0] == pref[1] {
writer.WriteRune(allot[0])
} else if allot[1] == pref[1] {
writer.WriteRune(allot[1])
}
writer.WriteString("\n")
}
writer.Flush()
}

func scanInt() int {
scanner.Scan()
x, err := strconv.ParseInt(scanner.Text(), 10, 32)
if err != nil {
panic("cannot convert input to Int")
}
return int(x)
}

func scanChar() rune {
scanner.Scan()
return []rune(scanner.Text())[0]
}
``````
##### Utkarsh and Placement tests CodeChef Solution Review:

In our experience, we suggest you solve this Utkarsh and Placement tests CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.

If you are stuck anywhere between any coding problem, just visit Queslers to get the Utkarsh and Placement tests CodeChef Solution.

Find on CodeChef

##### Conclusion:

I hope this Utkarsh and Placement tests CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Programming Language in a business context; there are no prerequisites.

Keep Learning!