Question: Q-2 Single File Programming Question Marks: 20 Negative Marks : 0 There was a king who wish to conquer his enemy's country. To conquer


Q-2 Single File Programming Question Marks: 20 Negative Marks : 0 There was a king who wish to conquer his enemy's country. To conquer a country he must know about his enemy's boundary limits. Help him to find his enemy's boundary limits by writing a java program. Input format Integer: No of enemy country(N) N Integer corresponds to no. of villages in each country (M). M Integers corresponds to ID of each villages. Output format Integer output corresponds to ID of each village located at the boundary of each enemy's country. Sample testcases Input 1 4 4 2 1 6 12 66 78 10 10 2 100 123456 Output 1 12 10 10 2 Report Error 100 16 Note: The program will not be evaluated if "Submit Code' is not done atleast once Extra spaces and new line characters in the program output will also result in the testcase failing Q-1 Single File Programming Question Sum of the asked digits Input format Write a java program to calculate the sum of every ith digit in the given number. The input consists of a single integer 'n' which corresponds to the given number. Set of digits to be considered for calculating the sum will be provided as space separated integer values. Refer the sample input and output for more explanation. Long n Integer k Space separated k integers Code constraints 0 < Number of digits in the given number n < 10000 Sample testcases Input 1 1234567890 2 2.3 Output 1 32 Report Error Marks: 20 Negative Marks : 0 Note: The program will not be aluated if "Submit Code' is not done atleast once Extra spaces and new line characters in the program output will also result in the testcase failing
Step by Step Solution
3.42 Rating (155 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
