public class Test5C extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
removeA(String s)
Returns the string equal to the string formed by
removing all of the 'a' and 'A' characters from the
argument string s.
|
static int |
sumSkip(List<Integer> t)
Computes the sum of the elements in the argument list
t starting from the first element and skipping every
second element.
|
public static String removeA(String s)
For example:
Test5C.removeA("") returns the empty string
Test5C.removeA("a") returns the empty string
Test5C.removeA("B") returns the string "B"
Test5C.removeA("ABA") returns the string "B"
Test5C.removeA("BananA") returns the string "Bnn"
Test5C.removeA("aaaaAAAaaA") returns the empty string.
s - a non-null stringpublic static int sumSkip(List<Integer> t)
For example:
if t is [] then Test5C.sumSkip(t) returns 0 if t is [1] then Test5C.sumSkip(t) returns 1 if t is [-1, 2] then Test5C.sumSkip(t) returns -1 if t is [1, 2, 8] then Test5C.sumSkip(t) returns 9 if t is [1, 0, -9, 4] then Test5C.sumSkip(t) returns -8 if t is [1, 2, 12, -3, 15] then Test5C.sumSkip(t) returns 28
t - a non-null list of integers