Mmm what are u talking abouy
I think its the new age either that or end times
Answer:
word = input('Enter a single word: ', 's');
n = length(word);
nodupWord = [];
for i = 1:n
dup = false;
c = word(i);
for j = 1:i-1
if word(j) == c
dup = true;
break;
end
end
if ~dup
nodupWord = [nodupWord, c]; %add the non-duplicate char to end
end
end
disp(['Adjusted word: ', nodupWord])
Explanation:
The code is in Python.
1. C
2. B
3. C
4. A
5. A
6. B
7. C
8. D
9. C
10. B
11. D
12. D
13. D
14. A
15. A
16. B
17. A
18. B
19. D
20. B
Some of the ones towards the start may not be right but I gave it a go :)
Answer:
Explanation:
The following code is written in Java, the function takes in a list with the previous day's values. The function then uses that list, loops through it and multiplies each individual value by 2 and returns the modified list. The first red square represents the test case for the function, while the second red square in the image represents the output.
public static ArrayList<Integer> doubleIt(ArrayList<Integer> mylist) {
for (int x = 0; x<mylist.size(); x++) {
mylist.set(x, mylist.get(x)*2);
}
return mylist;
}