Final tasks
Comments (52)
- Popular
- New
- Old
You must be signed in to leave a comment
Anonymous #10782038 Java Developer at Microsoft
19 March, 19:17
max and min has a validator issue. I was getting the correct output but I set max = Integer.MIN_VALUE and in their solution they just set both to the first element of the array. My solution worked but their validator didnt like it for some reason.
0
Anonymous #10960894
29 March 2022, 07:57
in the maximum and minimum numbers task, there's no reason not to determine the max and min in the same loop in which they are entered, yet the validator doesn't like it :/
+2
Spydrow
4 May 2022, 15:15
I had the same problem
0
Pat
7 December 2022, 15:42
it was fixed, I used just single loop and it worked.
+1
Jakub Wasilczyk
8 September 2021, 14:35
shuffled just in time, im here so far:
father
mother
son
daughter
cat
dog
program
car
father
mother
son
daughter
when i :
it removes every 2nd line, why?:
mother
daughter
dog
car
father
mother
son
daughter 0
Jakub Wasilczyk
8 September 2021, 18:13
nvm, got it:
+1
Ewa Borysiewicz
12 January 2022, 22:54
I've had the same problem, that's because if you remove an item at index 0 then all the other items get shuffled to the left, so the item that was previously at index 1 is moved to index 0 etc. I bypassed it by iterating back to front, then removing items from index i of i was smaller than m :)
+1
Justin Smith
11 July 2021, 14:10
"Be sure that you just display the array in reverse order. You don't need to reverse the order of the elements in the list."
I don't understand this bit. How do you display an array (or arraylist) in reverse order without reversing the order of the elements? That sounds a bit like saying "paint the house red, but you don't need to paint the house red."
0
Justin Smith
11 July 2021, 14:31
Just checked if they mean the counting order of the numbers entered, no they do not mean that. I have no idea what this task wants me to do.
0
Banana Llama Frontend Developer
27 July 2021, 17:29
Think about how you are looping through arrays currently. Usually from start to finish. But you can also loop through the other way around by adjusting the for loop variable.
+4
P.B.Kalyan Krishna
27 April 2023, 16:24
That just means displaying the elements from the last. That is the last element in the array is displayed first followed by the second last element and so on. You just need to loop through the array in reverse order. Consider this:-
int [] arr = {1,2,3,4,5};
for(int i = arr.length - 1; i >=0; i--)
System.out.print(arr[i]);
This prints 5,4,3,2,1.
+1
DarthGizka
29 May 2021, 17:35
task0719 (Display numbers in reverse order) caveat: you will get failed if you use anything other than an ArrayList<Integer>, even though that requirement is not stated anywhere and this is not really an appropriate structure for the job.
+1
Anonymous #10782038 Java Developer at Microsoft
19 March, 18:39
It is clearly stated to use an Integer list.
0
Sunaina Yadav QA Engineer at Ness Technologies
27 January 2021, 14:14
Cat code won't compile exercise gives
java.lang.NullPointerException even when I download the correct solution and it passes testing.
I tried while(true){
String name = reader.readLine();
int age= Integer.parseInt(reader.readLine();
int weight=Integer.parseInt(reader.readLine();
int tailLength=Integer.parseInt(reader.readLine();
then pass these values to the constructor.
But it keeps giving me NumberFormatException
Don't know what is wrong with this but got an answer that I am trying to convert null to int.
0
Mihai Bone
14 December 2020, 22:04
Family census: Tips - Don't try like me to recreate their output ...... just display 4 objects with 3 parameter and 5 objects with 5 parameter
+1
Brad Reed
2 July 2020, 18:42
raise your hand if you've been victimized by predictive text... I know I have LOL
0
Mayu
3 June 2020, 05:28
When it says the solution to the task is better than X% other students, what's the metric being used. Is it complexity or efficiency?
+3
Oliver Heintz
16 June 2020, 01:17
I'm fairly certain all they're reporting is number of attempts.
+4
Kent Hervey Software Engineer/Consult Expert
20 November 2019, 03:55
Shuffled Just in Time...I don't really understand what this means: Move the first M strings to the end of the list.
Does it mean that for the sample data the output would be (move the first four to the end in order)...
cat
dog
program
car
father
mother
son
daughter
??
+2
Seb
9 January 2020, 16:56
Yes, that's it.
+5