Join Regular Classroom : Visit ClassroomTech

Month: June 2021

Accenture Coding Question | String Palindrome | CodeWindow

String Palindrome Write a function to find if the given string string is palindrome or not. Return 1 if the input string is a palindrome, else return 0. Input specification:Input 1: A string of characters. Output Specification:0 or 1 depending on whether the string is a palindrome or not. Example 1:Input 1: level Output: 1Explanation:The …

Accenture Coding Question | String Palindrome | CodeWindow Read More »

Accenture Coding Question | Largest Sub-Array | CodeWindow

Largest Sub Array Given an array containing only 0’s and 1’s, Find the largest subarray containing an equal number of 0s and 1s. Input specification:Input 1: The length of an array.Input 2: Array containing 0s and 1s. Output Specification:Return the length of the largest sub-array containing equal no. of 0s and 1s. Example 1:Input 1: …

Accenture Coding Question | Largest Sub-Array | CodeWindow Read More »

Accenture Coding Question | Quadratic Equation Roots | CodeWindow

Quadratic Equation Roots Write a function to calculate roots of a quadratic equation of the from ax^2+bx+c=0The formula to find the roots of a quadratic equation is given below:X+ = (-b + root of (b^2 – 4ac))/2aX- = (-b – root of (b^2 – 4ac))/2a Input specification:Input 1: A double value representing the coefficient value …

Accenture Coding Question | Quadratic Equation Roots | CodeWindow Read More »

Accenture Coding Question | Sum of Uncommon Elements | CodeWindow

Sum of Uncommon Elements The function accepts two integer arrays ‘arr’ and ‘arr2’ of sizes n and m respectively as its argument. Implement the function to find and return the sum of all uncommon elements in two arrays (elements which are present in only one of the array).Note:Return -1 if both arrays are null (None …

Accenture Coding Question | Sum of Uncommon Elements | CodeWindow Read More »

Accenture Coding Question | Sum Of Divisor | CodeWindow

Sum of divisors Print the sum of the divisors of the integer number N. Input specification:Input 1: The integer ‘n’. Output Specification:Return the sum of divisors of ‘n’. Example 1:Input 1: 6 Output: 12Explanation:Divisors of 6 are 1,2,3,6. Sum of number (1+2+3+6)=12 Example 2:Input 1: 36 Output: 91Explanation:Divisors of 36 are 1,2,3,4,6,9,12,18,36. Sum of number …

Accenture Coding Question | Sum Of Divisor | CodeWindow Read More »