Posts

problem no 54:convert an integer to roman.

 question:                         Convert integer to Roman No Basic Accuracy: 49.9% Submissions: 14164 Points: 1 Given an integer n, your task is to complete the function convertToRoman which prints the corresponding roman number of n. Various symbols and their values are given below. I 1 V 5 X 10 L 50 C 100 D 500 M 1000

problem no 53:(problem on binary tree): counting the number of the leaf nodes in the binary tree.

Question:

problem no 52:(problem on linked list):find the number of occurances of the given integer inside the linked list.

 QUESTION: Occurence of an integer in a Linked List Easy Accuracy: 56.23% Submissions: 31590 Points: 2 Given a singly linked list and a key, count the number of occurrences of given key in the linked list. Example 1: Input: N = 7 Link List = 1->2->1->2->1->3->1 search_for = 1 Output: 4 Explanation: 1 appears 4 times. Example 2: Input: N = 5 Link List = 1->2->1->2->1 search_for = 3 Output: 0 Explanation: 3 appears 0 times.  

problem no 51:find the remainder when the string is divided by 7.

 QUESTION: Remainder with 7 Basic Accuracy: 46.43% Submissions: 9141 Points: 1 Given a number as string(n) , find the remainder of the number whe it is divided by 7 Example 1: Input: 5 Output: 5   Example 2: Input: 8 Output: 1      // IS FOR COMMENT. ANSWER: int remainderWith7(string num) {     // This series is used to find remainder with 7     int series[] = {1, 3, 2, -1, -3, -2};       // Index of next element in series    ...

problem no 50:josephus problem:(recursion problem).

 QUESTION: Josephus problem Easy Accuracy: 52.47% Submissions: 34010 Points: 2 Given the total number of persons n and a number k which indicates that k-1 persons are skipped and k th person is killed in circle in a fixed direction. The task is to choose the safe place in the circle so that when you perform these operations starting from 1 st place in the circle, you are the last one remaining and survive. Example 1: Input: n = 3 k = 2 Output: 3 Explanation: There are 3 persons so skipping 1 person i.e 1s...

problem no 49:sorting problem:sort the array if the first half and the second half of the array is sorted.

QUESTION:

problem no 48:sorting problem:find the triplet inside the array that sum up to the given particular value.

 QUESTION: Triplet Sum in Array Given an array arr of size arr_size and an integer sum. Find if there's a triplet in the array which sums up to the given integer sum. Example 1: Input : N = 6, X = 13 arr[] = [1 4 45 6 10 8] Output : 1 Explanation : The triplet {1, 4, 8} in the array sums up to 13. Example 2: Input : N = 5, X = 10 arr[] = [1 2 4 3 6] Output : 1 Explanation : The triplet {1, 3, 6} in the array sums up to 10.