Professional Documents
Culture Documents
https://www.youtube.com/c/PappuCareerGuide/
#include <bits/stdc++.h>
double second_term;
double third_term;
int n;
cin>>second_term>>third_term>>n;
double a = second_term/r;
return 0;
}
https://t.me/techmahindra2021crack
In Python
Coming Soon.....
In C
Coming Soon.....
https://www.freshersocjob.com/2021/04/tech-mahindra-2nd-round-12th-april-exam.html 1/8
7/2/22, 11:40 PM Tech Mahindra 2nd Round 12th April Exam Shifts All Sections Question with Solution | Non-SDE Tech & Psychometric Asses…
https://www.youtube.com/c/PappuCareerGuide/
#include <bits/stdc++.h>
int main() {
// a#b#c
// ex
// 10 - binary- 1 0 1 0
// output 2#1#3
int n;
cin>>n;
int c=-1;
int i=0;
// solved by Pappu Career Guide
{
if(n&1)
{
a++;
if(b==-1)
{
b=i;
}
c=i;
https://www.freshersocjob.com/2021/04/tech-mahindra-2nd-round-12th-april-exam.html 2/8
7/2/22, 11:40 PM Tech Mahindra 2nd Round 12th April Exam Shifts All Sections Question with Solution | Non-SDE Tech & Psychometric Asses…
}
i++;
In Python
n=int(input())
bi=bin(n)
bi=int(bi[2:])
x=[]
while(bi>0):
x.append(bi%10)
bi//=10
a=x.count(1)
b=x.index(1)
x.reverse()
c=len(x)-x.index(1)-1
print(a,b,c,sep="#")
In C
https://www.freshersocjob.com/2021/04/tech-mahindra-2nd-round-12th-april-exam.html 3/8
7/2/22, 11:40 PM Tech Mahindra 2nd Round 12th April Exam Shifts All Sections Question with Solution | Non-SDE Tech & Psychometric Asses…
Coming Soon.....
https://t.me/techmahindra2021crack
#include <bits/stdc++.h>
string helper(string s)
{
int arr[26]={0}; // there are 26 alphabets
in the english char
for(int i=0;i<s.length();i++) // loop through
the input string
{
arr[s[i]-97]++; //
to come back with the 0 position
}
string result="";
{
char ch = 97+i; // add the value of
ASCII value of i = 1 - taking b
https://www.freshersocjob.com/2021/04/tech-mahindra-2nd-round-12th-april-exam.html 4/8
7/2/22, 11:40 PM Tech Mahindra 2nd Round 12th April Exam Shifts All Sections Question with Solution | Non-SDE Tech & Psychometric Asses…
result+=ch;
result+=to_string(arr[i]);
}
}
return result;
https://t.me/techmahindra2021crack
}
int main() {
string s;
cin>>s;
cout<<helper(s);
return 0;
In Python
Coming Soon.....
In C
Coming Soon.....
https://www.freshersocjob.com/2021/04/tech-mahindra-2nd-round-12th-april-exam.html 5/8
7/2/22, 11:40 PM Tech Mahindra 2nd Round 12th April Exam Shifts All Sections Question with Solution | Non-SDE Tech & Psychometric Asses…
#include <bits/stdc++.h>
using namespace std;
// Solved By Pappu Kumar (Coder Guy)
string helper(string s)
{
string result = ""; // answer store string
{
char ch = char((s[i] + 3 - 97)%26 + 97);
result+=ch;
}
return result;
}
int main() {
string s;
cin>>s;
cout<<helper(s);
return 0;
https://www.freshersocjob.com/2021/04/tech-mahindra-2nd-round-12th-april-exam.html 6/8
7/2/22, 11:40 PM Tech Mahindra 2nd Round 12th April Exam Shifts All Sections Question with Solution | Non-SDE Tech & Psychometric Asses…
}
https://t.me/techmahindra2021crack
In C
Coming Soon.....
In Python
Coming Soon.....
5. Number of Decodings
def numDecodings(s):
if not s:
return 0
dp[0] = 1
https://www.freshersocjob.com/2021/04/tech-mahindra-2nd-round-12th-april-exam.html 7/8
7/2/22, 11:40 PM Tech Mahindra 2nd Round 12th April Exam Shifts All Sections Question with Solution | Non-SDE Tech & Psychometric Asses…
dp[i] += dp[i - 1]
dp[i] += dp[i - 2]
return dp[len(s)]
https://t.me/techmahindra2021crack
s=input()
print(numDecodings(s))
In C
Coming Soon.....
In c++
Coming Soon.....
https://www.freshersocjob.com/2021/04/tech-mahindra-2nd-round-12th-april-exam.html 8/8