Skip to content

Commit

Permalink
reverting reverse sequence string
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed Jun 15, 2022
1 parent 8e71974 commit c6d714c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/getReverseSequenceString.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
module.exports = function getReverseSequenceString(s) {
return [...s].reverse().join("");
module.exports = function getReverseSequenceString(sequence) {
let reverseSequenceString = "";
for (let i = sequence.length - 1; i >= 0; i--) {
let revChar = sequence[i];
if (!revChar) {
revChar = sequence[i];
// throw new Error('trying to get the reverse of an invalid base');
}
reverseSequenceString += revChar;
}
return reverseSequenceString;
};

0 comments on commit c6d714c

Please sign in to comment.