Page 3 of 12
1 2 3 4 5 12

Coding Questions

Accenture Coding Question | Adam’s Charity | CodeWindow

Adam’s Charity Adam decides to be generous and do some charity. starting today, from day 1 until day n, he gives i^2 coins to charity on day ‘i’ (1<=i<=n).return the total coins he would give to charity. Input specification:Input 1: number of days of Charity. Output Specification:Return the total number of coins till charity days. …

Accenture Coding Question | Adam’s Charity | CodeWindow Read More »

Accenture Coding Question | Reverse String Wordwise | CodeWindow

Reverse String Word Wise Write a function to reverse a string word-wise. Input specification:Input 1: String Output Specification:Return the reversed string that is the last word in input string should come at the first position of the output string second last word at he second position and so on., individual words should remain same. Example …

Accenture Coding Question | Reverse String Wordwise | CodeWindow Read More »

Accenture Coding Question | Second Largest Number | CodeWindow

Second Largest Given an array (containing at most 1000 positive integers), find the second largest integer. If there exists no second largest integer, return -1. Input specification:Input 1: Length of the array.Input 2: an array of positive integers. Output Specification:Return the second largest number or -1 accordingly. Example 1:Input 1: 3Input 2: {2,1,2} Output: 1Explanation:1 …

Accenture Coding Question | Second Largest Number | CodeWindow Read More »

Accenture Coding Question | Nth Prime Number | CodeWindow

Prime Numbers A prime number is a whole number greater than 1 that is divisible only by itself and the number 1. For example, 2,3,5 etc are at prime numbers as they are divisible only by themselves and 1. Input specification:Input 1: An integer n. Output Specification:Return the nth prime. Example 1:Input 1: 1 Output: …

Accenture Coding Question | Nth Prime Number | CodeWindow Read More »

Accenture Coding Question | Maximum Sum of Column and Row | CodeWindow

Maximum Sum Write a program that adds up the largest row sum and the largest column sum from an N-rows *M-columns array numbers. Input specification:Input1: Integer for row dimension of the array. Input2: Integer for column dimension of the array.Input3: Array elements to be entered in row major. Output Specification:Largest row sum + Largest column …

Accenture Coding Question | Maximum Sum of Column and Row | CodeWindow Read More »

Accenture Coding Question | String Within a String | CodeWindow

String within String Given two strings, ‘X’ and ‘Y’ (length(X)>=1, length(Y)<=10000), find out if ‘Y’ is contained in ‘X’ Input specification:Input1: The string ‘X’.Input2: The string ‘Y’. Output Specification:Return “yes” if ‘Y’ is contained in ‘X’ else return no. Example 1:Input 1: abacInput 2: ab Output: yesExplanation:ab is present with abac Example 2:Input 1: xyacInput …

Accenture Coding Question | String Within a String | CodeWindow Read More »

Accenture Coding Question | Anagrams | CodeWindow

Anagrams An anagram is a word, phrase, or name formed by rearranging the letters of another word, phrase or name. Write a function to check if the given two strings are anagrams or not. return “Yes” if they are anagrams otherwise return “No”. Input specification:Input1: The first string.Input2: The second string. Output Specification:return “Yes” if …

Accenture Coding Question | Anagrams | CodeWindow Read More »

Accenture Coding Question | Factorials | CodeWindow

Accenture Coding QuestionFactorials Given ‘a’ (1<=n<=100), find the factorial of ‘n’. The factorial of ‘n’ is defined as the product of all integers.Input specification:Input : any number ‘n’ Output Specification:Return a string containing the factorial. Example 1:Input : 5 Output: 120Explanation:5!=5*4*3*2*1 = 120 Example 2:Input 1: 6 Output: 720Explanation: 6!=6*5*4*3*2*1 = 720 JOIN OUR TELEGRAM …

Accenture Coding Question | Factorials | CodeWindow Read More »

Accenture Coding Question | Next Greater Number | CodeWindow

Next Greater Number Write a number ‘N’ (containing at most 10,000 digits), find the next grater number having the same digits. It is guaranteed that there exists a next greater number having the same digits as N. Input specification:Input1: The length of the string ‘N’. Input2: The number ‘N’ in the form of a string. …

Accenture Coding Question | Next Greater Number | CodeWindow Read More »

Accenture Coding Question | Reverse In Array | CodeWindow

Write a function that returns the reverse of the input array. Input specification:Input1: an array of numbersInput2: length of the array(input1) Output Specification:Return an array in reverse order. Example 1:Input 1: {1,2,3}Input 2: 3 Output: {3,2,1}Explanation:The reverse of the array {1,2,3} will be {3,2,1} Example 2:Input 1: {4,6,7,2}Input 2: 4 Output: {2,7,6,4} Explanation:The reverse of the …

Accenture Coding Question | Reverse In Array | CodeWindow Read More »