Advertisement
Guest User

Untitled

a guest
May 28th, 2020
942
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. function solve(n){
  2. let arr = 'ATCGTTAGGG'.split('')
  3. for(let i = 1; i <= n; i++){
  4. let [a, b] = arr.splice(0,2)
  5. if(i === 1 || i % 4 === 1){
  6. console.log(`**${a}${b}**`);
  7. }
  8. else if(i === 2 || i % 4 === 2){
  9. console.log(`*${a}--${b}*`);
  10. }
  11. else if(i === 3 || i % 4 === 3){
  12. console.log(`${a}----${b}`);
  13. }
  14. else if(i === 4 || i % 4 === 0){
  15. console.log(`*${a}--${b}*`);
  16. }
  17.  
  18. arr.push(a)
  19. arr.push(b)
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement