Divide two strings by half-width space (equivalent to paiza rank D)
Attempt to run with split method results in an error.
Please let me know.
process.stdin.resume();
process.stdin.setEncoding('utf8');
varlines=[];
var reader=require('readline').createInterface({
input:process.stdin,
output —process.stdout
});
reader.on('line',(line)=>{
lines.push(line);
});
reader.on('close',()=>{
for (varwords of values) {
var values = words.split('lines');
console.log(values);
}
});
If you look at the script, lines
is defined as var lines=[];
, while for(var words of values){
uses undefined values
.This is likely to cause values is not possible
errors.I thought this might be a error.
Therefore, please correct it as below and try again.
for (var words of values) {
for (var words of lines) {
635 Uncaught (inpromise) Error on Electron: An object could not be cloned
624 GDB gets version error when attempting to debug with the Presense SDK (IDE)
579 Understanding How to Configure Google API Key
586 PHP ssh2_scp_send fails to send files as intended
930 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.