Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Find Quotes by hkgok1
import assert from "assert";
function findQuotes(text: string): string[] {
// your code here
var cnt = 0;
var st = 0;
var ed = 0;
var rt = [];
var f =0;
//console.log(text.indexOf('"',1))
do {
if (f==0) {
st = text.indexOf('"',cnt)+1;
//console.log(st)
f = 1;
cnt = st;
} else if (f==1) {
ed = text.indexOf('"',cnt);
f = 0;
cnt = ed+1;
rt.push(text.slice(st,ed));
}
} while ((text.indexOf('"',cnt)!=-1) && (cnt
March 17, 2022
Comments: