Accenture Coding Questions Answers
Accenture Coding Questions Answers
#OUTPUT:
31) Add two fractions
#Code:
#OUTPUT:
STEP : 1 (Qn: 18, 19)
#Code:
#OUTPUT:
19) Count possible decoding of a given digit sequence
#Code
#OUTPUT :
STEP 2: (Qn: 49, 50, 51)
#Code:
#OUTPUT:
50) Check if two strings match where one string contains wildcard
characters
#Code:
#OUTPUT:
51) Print all permutations of a given string in lexicographically sorted
order
#Code:
#OUTPUT:
STEP 3: (Slide no: 87, 88, 89)
Slide 87
The Greatest Common Divisor(GCD) of two or more Integers (at least
one of which is not zero), is the largest positive integer that divides the
numbers without a remainder.
Given two numbers, 'a' and 'b' as input, implement the following
function to find and return their greatest common divisor:
Example:
Input:
8
12
Output:
4
Explanation:
8-2*2*2
12-2*2*3
gcd(8, 12) - 4
Thus, the output is 4.
Sample Input
36
63
Sample Output
9
#Code:
#OUTPUT:
Slide 88
The function accepts a positive integer 'n' as its argument. A number 'n'
can always be represented as a sum of squares of other integers.
Implement the function to find the count of minimum number of
squares that adds up to 'n' and retum the court.
Input: n: 13
Output: 2
#Code:
#OUTPUT :
Slide 89
You are given a function,
int FindLargestPairSum(int* arr, int n);
The function accepts an integer array 'arr' of length 'n'. Implement the
function to find the largest pair sum in 'arr'. Here, you need to find two
elements whose sum is the largest of all the other pairs sum and print
the result.
Input: arr: 3 9 2 30 12 17
Output: 47
Explanation: The largest pair sum will be 30 + 17, l.e. 47.
#Code :
#OUTPUT: