Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Error of one of the elements when starting the program

$
0
0
I wrote the source code for a new application on IOS, there were no errors on the tests, but when I ran the code, an error appeared in t$$anonymous$$s place, I don’t understand where and what’s wrong var t = readLine()! var s = readLine()! var len_s = s.count var t_lis = Set(t) var c_s = Counter(s) var c_t = Counter(t_lis[len_s]) var c_res = [String: String]() var summ = 0 for e in c_s{ c_res[e] = [c_s[e], min( c_s[e], c_t[e] )] summ += c_res[e][1]} for i in (t.count-s.count) + 1 { if summ == len_s-1{ print(i) break } if t in c_res if c_res[t][1] > 0{ c_res[t][1] -= 1 summ -= 1 } if i+len_s < t.count && t[i+len_s] in c_res if c_res[ t[i+len_s] ][1] < c_res[ t[i+len_s] ][0]{ c_res[ t[i+len_s] ][1] += 1 summ += 1 } else print(-1) } Who can tell how to be? And does anyone know a quality code analysis service? What can make one code unique across multiple projects. Thanks in advance!

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>