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
<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>
Comments
Leave a comment