Skip to content

Commit 3c1d73a

Browse files
committed
7-4 autograde bug fix
1 parent 56a83dc commit 3c1d73a

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

_sources/Unit7-ArrayList/topic-7-4-arraylist-algorithms.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ In the last lesson, the coding challenge involved finding pairs. You should be a
433433
if (a[i] == a[j])
434434
{ #paired
435435
=====
436-
return true;
436+
return true;
437437
=====
438438
} // end if
439439
=====
@@ -598,10 +598,10 @@ We can write code that shifts or rotates elements left or right in an ``ArrayLis
598598
{
599599
// instantiate ArrayList and fill with Integers
600600
ArrayList<Integer> values = new ArrayList<Integer>();
601-
int[] nums = {1, 5, 7};
602-
for (int i = 0; i < nums.length; i++)
601+
int[] arrnums = {1, 5, 7};
602+
for (int i = 0; i < arrnums.length; i++)
603603
{
604-
values.add(nums[i]);
604+
values.add(arrnums[i]);
605605
}
606606
rotateLeft(values);
607607
System.out.println("Expected Result: [5, 7, 1]");
@@ -642,19 +642,20 @@ We can write code that shifts or rotates elements left or right in an ``ArrayLis
642642
assertTrue(passed);
643643
}
644644
@Test
645-
public void test2()
646-
{
645+
public void test2()
646+
{
647647
ArrayList<Integer> list = new ArrayList<Integer>();
648648
list.add(2);
649649
list.add(4);
650650
list.add(0);
651651
list.add(-2);
652652
String expect = "[4, 0, -2, 2]";
653-
String output = "" + TestRotate.rotateLeft(list);
653+
TestRotate.rotateLeft(list);
654+
String output = "" + list;
654655
boolean passed = getResults(expect, output, "rotateLeft with list 2,4,0,-2");
655656
assertTrue(passed);
656-
}
657-
}
657+
}
658+
}
658659

659660
Reversing an ``ArrayList``
660661
-----------------------------

0 commit comments

Comments
 (0)