Coding-ninjas icon indicating copy to clipboard operation
Coding-ninjas copied to clipboard

Java

Results 6 Coding-ninjas issues
Sort by recently updated
recently updated
newest added

The solution was not able to pass some test cases so I changed the condidtion in if statement. The case where two numbers are same also results false hence this...

For the below input : 1 11 orginal output required is : 1 3 5 7 9 11 10 8 6 4 2 But with your code , the output...

Scanner s = new Scanner(System.in); int x = s.nextInt(); int a = 5; int d = 3; for(int i=1;i

its gives solution with 0000 at the end of output

// should be implemented before for loop if (str == null || str.isEmpty()) { return 0; }