Answer to Question #271067 in HTML/JavaScript Web Application for prime

Question #271067

String Slicing


https://drive.google.com/drive/folders/1KPus4l0U5mppjMI4uysBd7nYyosJWCej?usp=sharing


Please fill the code in "write your code here"


They were just sample outputs. There are other test cases too which should be passed


1
Expert's answer
2021-11-25T16:24:51-0500
  <script>
    'use strict';



    process.stdin.resume();
    process.stdin.setEncoding('utf-8');



    let inputString = '';
    let currentLine = 0;



    process.stdin.on('data', inputStdin => {
      inputString += inputStdin;
    });



    process.stdin.on('end', _ => {
      inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
      });


      main();
    });



    function readLine() {
      return inputString[currentLine++];
    }



    function main() {
      const inputString = readLine();
      const subString = readLine();



      let index = aqString.find(inputString, subString);
      if (isNaN(index) && index <= inputString.length) {
        console.log(inputString.split(index));
      }
    }
  </script>

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS