You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/fcc-intermediate-algorithms/fcc-intermediate-algorithms.md
+39-1Lines changed: 39 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ export function destroyer(arr, ...values) {
58
58
59
59
Make a function that looks through an array of objects (first argument) and returns an array of all objects that have matching name and value pairs (second argument). Each name and value pair of the source object has to be present in the object from the collection if it is to be included in the returned array.
60
60
61
-
For example, if the first argument is [{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], and the second argument is { last: "Capulet" }, then you must return the third object from the array (the first argument), because it contains the name and its value, that was passed on as the second argument.
61
+
For example, if the first argument is `[{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }]`, and the second argument is `{ last: "Capulet" }`, then you must return the third object from the array (the first argument), because it contains the name and its value, that was passed on as the second argument.
62
62
63
63
```javascript
64
64
exportfunctionwhatIsInAName(collection, source) {
@@ -135,3 +135,41 @@ export function myReplace(str, before, after) {
135
135
return [preInsert, after, postInsert].join('');
136
136
}
137
137
```
138
+
139
+
#### DNA Pairing
140
+
141
+
The DNA strand is missing the pairing element. Take each character, get its pair, and return the results as a 2d array.
142
+
143
+
Base pairs are a pair of `AT` and `CG`. Match the missing element to the provided character.
144
+
145
+
Return the provided character as the first element in each array.
146
+
147
+
For example, for the input `GCG`, return `[["G", "C"], ["C","G"],["G", "C"]]`
148
+
149
+
The character and its pair are paired up in an array, and all the arrays are grouped into one encapsulating array.
0 commit comments