Answer:
public static void removeInRange(List<Integer> list, int value, int start, int end) {
for (int i = end - 1; i >= start; i--) {
if (list.get(i) == value) {
list.remove(i);
}
}
System.out.println(list);
}
Explanation:
- Create a method named <em>removeInRange</em> that takes four parameters, a list, an integer number, a starting index and an ending index
- Inside the method, initialize a <u>for loop</u> that iterates between starting index and ending index
- If any number between these ranges is equal to the given <em>value</em>, then remove that value from the list, using <u>remove</u> method
- When the loop is done, print the new list
Answer:
Hello
Explanation:
Hello profile picture of a nub how are you doing today?
I would think the answer is C. Hope this helps! :D
Answer:
import java.util.ArrayList;
import java.util.Collections;
class Bulgarian
{
public static void main(String[] args)
{
max_cards=45;
arr->new ArraryList
col=1;
card=0;
left=max_cards;
do{
col->random number
row->new ArrayList;
for i=0 to i<col
{
card++
add card into row
}
add row into arr
left=max_cards-card;
}while(card<max_cards);
finish->false
while(!finish)
{
for i=0 to arr.size()
remove one card from each row
add row into arr
size->new ArrayList;
for i=0 to i<arr.size()
add arr[i] into size
sort(size)
for i=1 to size.size()
if ith element is equals to (i-1)+1
finish->true
else
finish->false
for i=0 to i<arr.size()
print->arr elements
}
}
}