message
stringlengths
2
23.8k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
97
109k
cluster
float64
0
0
__index_level_0__
int64
194
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. After learning some fancy algorithms about palindromes, Chouti found palindromes very interesting, so he wants to challenge you with this problem. Chouti has got two strings A and B. Since he l...
instruction
0
18,588
0
37,176
No
output
1
18,588
0
37,177
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. After learning some fancy algorithms about palindromes, Chouti found palindromes very interesting, so he wants to challenge you with this problem. Chouti has got two strings A and B. Since he l...
instruction
0
18,589
0
37,178
No
output
1
18,589
0
37,179
Provide tags and a correct Python 3 solution for this coding contest problem. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code 091), a colon (ASCII code 058), some (...
instruction
0
18,590
0
37,180
Tags: greedy, implementation Correct Solution: ``` s = list(input()) for i in range(len(s)): if s[i] == "[": index = i break else: print(-1) exit() s = s[index+1:] # print(s) for i in range(len(s)): if s[i] == ":": index = i break else: print(-1) exit() s = s[index+1:] s = s[::-1] # print(s) for i in rang...
output
1
18,590
0
37,181
Provide tags and a correct Python 3 solution for this coding contest problem. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code 091), a colon (ASCII code 058), some (...
instruction
0
18,591
0
37,182
Tags: greedy, implementation Correct Solution: ``` accord = input() open_bracket = accord.find("[") accord=accord[open_bracket+1:] open_colon = accord.find(":") accord = accord[open_colon+1:] close_bracket = accord.rfind("]") close_colon = accord[:close_bracket].rfind(":") if open_bracket == -1 or open_colon == -1 or...
output
1
18,591
0
37,183
Provide tags and a correct Python 3 solution for this coding contest problem. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code 091), a colon (ASCII code 058), some (...
instruction
0
18,592
0
37,184
Tags: greedy, implementation Correct Solution: ``` import sys s = sys.stdin.readline() ls = len(s) l1 = s.find('[') r1 = ls - 1 - s[::-1].find(']') if l1 == -1 or r1 == ls or l1 > r1: print(-1) exit(0) l2 = s.find(':', l1+1, r1) r2 = r1 - 1 - s[r1-1:l1:-1].find(':') if l2 == -1 or r2 == ls or l2 == r2: pri...
output
1
18,592
0
37,185
Provide tags and a correct Python 3 solution for this coding contest problem. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code 091), a colon (ASCII code 058), some (...
instruction
0
18,593
0
37,186
Tags: greedy, implementation Correct Solution: ``` s=input() flag=False ind=0 for i in range(len(s)-1,-1,-1): if s[i]=="]": flag=True ind=i break if flag: flag=False for i in range(ind-1,-1,-1): if s[i]==":": flag=True ind=i break if flag: flag=False for i in range(ind): if s[i]=="[": fl...
output
1
18,593
0
37,187
Provide tags and a correct Python 3 solution for this coding contest problem. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code 091), a colon (ASCII code 058), some (...
instruction
0
18,594
0
37,188
Tags: greedy, implementation Correct Solution: ``` s = input() n = len(s) open_b = -1 close_b = -1 open_d = -1 close_d = -1 for i in range(n): if s[i] == '[': open_b = i break for i in range(n): if s[i] == ']': close_b = i if open_b == -1 or close_b == -1: print(-1) exit() for i ...
output
1
18,594
0
37,189
Provide tags and a correct Python 3 solution for this coding contest problem. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code 091), a colon (ASCII code 058), some (...
instruction
0
18,595
0
37,190
Tags: greedy, implementation Correct Solution: ``` s=input() ob=s.find('[') cb=s.rfind(']') fc=s[ob:cb].find(':') sc=s[ob:cb].rfind(':') if ob>cb or fc==sc: print(-1) else: print(4+s[ob+fc:ob+sc].count('|')) ```
output
1
18,595
0
37,191
Provide tags and a correct Python 3 solution for this coding contest problem. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code 091), a colon (ASCII code 058), some (...
instruction
0
18,596
0
37,192
Tags: greedy, implementation Correct Solution: ``` s = input() l,r = s.find('['), s.rfind(']') if l == -1 or r == -1: print(-1) else: news = s[l:r+1] l2,r2 = news.find(':'),news.rfind(':') if l2 == r2: print(-1) else: v = news[l2:r2+1].count("|") print(v+4) ```
output
1
18,596
0
37,193
Provide tags and a correct Python 3 solution for this coding contest problem. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (ASCII code 091), a colon (ASCII code 058), some (...
instruction
0
18,597
0
37,194
Tags: greedy, implementation Correct Solution: ``` import re s = input() s = re.sub('[a-z]', '', s) start = s.find('[') if start > -1: s = s[start:] end = s.rfind(']') if end > -1: s = s[:end + 1] start = s.find(':') end = s.rfind(':') if start != end: s = s[star...
output
1
18,597
0
37,195
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (AS...
instruction
0
18,598
0
37,196
Yes
output
1
18,598
0
37,197
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (AS...
instruction
0
18,599
0
37,198
Yes
output
1
18,599
0
37,199
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (AS...
instruction
0
18,600
0
37,200
Yes
output
1
18,600
0
37,201
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (AS...
instruction
0
18,601
0
37,202
Yes
output
1
18,601
0
37,203
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (AS...
instruction
0
18,602
0
37,204
No
output
1
18,602
0
37,205
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (AS...
instruction
0
18,603
0
37,206
No
output
1
18,603
0
37,207
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (AS...
instruction
0
18,604
0
37,208
No
output
1
18,604
0
37,209
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. An accordion is a string (yes, in the real world accordions are musical instruments, but let's forget about it for a while) which can be represented as a concatenation of: an opening bracket (AS...
instruction
0
18,605
0
37,210
No
output
1
18,605
0
37,211
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Alice and Bob play a game. They have a binary string s (a string such that each character in it is either 0 or 1). Alice moves first, then Bob, then Alice again, and so on. During their move, t...
instruction
0
18,716
0
37,432
No
output
1
18,716
0
37,433
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Alice and Bob play a game. They have a binary string s (a string such that each character in it is either 0 or 1). Alice moves first, then Bob, then Alice again, and so on. During their move, t...
instruction
0
18,717
0
37,434
No
output
1
18,717
0
37,435
Provide tags and a correct Python 3 solution for this coding contest problem. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn...
instruction
0
18,720
0
37,440
Tags: constructive algorithms, strings Correct Solution: ``` import math import sys,bisect from heapq import * from itertools import * from collections import * sys.setrecursionlimit(10 ** 6) I = lambda : int(sys.stdin.readline()) neo = lambda : map(int, sys.stdin.readline().split()) Neo = lambda : list(map(int, sys.st...
output
1
18,720
0
37,441
Provide tags and a correct Python 3 solution for this coding contest problem. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn...
instruction
0
18,721
0
37,442
Tags: constructive algorithms, strings Correct Solution: ``` s = input() n = len(s) print(3) pre = n-2 print('L',n-1) print('R',n-2+1) total = n + n-1 + n-2+1 print('R',total-pre-1) ```
output
1
18,721
0
37,443
Provide tags and a correct Python 3 solution for this coding contest problem. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn...
instruction
0
18,722
0
37,444
Tags: constructive algorithms, strings Correct Solution: ``` x=input() print(3) print('L 2') print('R 2') print('R',2*len(x)-1) ```
output
1
18,722
0
37,445
Provide tags and a correct Python 3 solution for this coding contest problem. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn...
instruction
0
18,723
0
37,446
Tags: constructive algorithms, strings Correct Solution: ``` s = input() l = len(s) ans = [] ans.append(['R',l-1]) l += 1 ans.append(['R',l-1]) l += 1 ans.append(['L',l-1]) l = l + l-2 ans.append(['L',2]) print(len(ans)) for g in ans: print(*g) ```
output
1
18,723
0
37,447
Provide tags and a correct Python 3 solution for this coding contest problem. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn...
instruction
0
18,724
0
37,448
Tags: constructive algorithms, strings Correct Solution: ``` s = input() print(3) print("L", 2) print("R", 2) k = 2 * len(s) - 1 print("R", k) ```
output
1
18,724
0
37,449
Provide tags and a correct Python 3 solution for this coding contest problem. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn...
instruction
0
18,725
0
37,450
Tags: constructive algorithms, strings Correct Solution: ``` import sys import math from collections import Counter,defaultdict LI=lambda:list(map(int,input().split())) MAP=lambda:map(int,input().split()) IN=lambda:int(input()) S=lambda:input() def case(): s = S() n =...
output
1
18,725
0
37,451
Provide tags and a correct Python 3 solution for this coding contest problem. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn...
instruction
0
18,726
0
37,452
Tags: constructive algorithms, strings Correct Solution: ``` s = input() n = len(s) print(3) print('L', n - 1) print('R', n - 1) print('R', 2 * n - 1) ```
output
1
18,726
0
37,453
Provide tags and a correct Python 3 solution for this coding contest problem. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn...
instruction
0
18,727
0
37,454
Tags: constructive algorithms, strings Correct Solution: ``` a = input() n = len(a) print(3) print("R",n-1) print("L",n) print("L",2) ```
output
1
18,727
0
37,455
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his ...
instruction
0
18,728
0
37,456
Yes
output
1
18,728
0
37,457
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his ...
instruction
0
18,729
0
37,458
Yes
output
1
18,729
0
37,459
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his ...
instruction
0
18,730
0
37,460
Yes
output
1
18,730
0
37,461
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his ...
instruction
0
18,731
0
37,462
Yes
output
1
18,731
0
37,463
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his ...
instruction
0
18,732
0
37,464
No
output
1
18,732
0
37,465
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his ...
instruction
0
18,733
0
37,466
No
output
1
18,733
0
37,467
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his ...
instruction
0
18,734
0
37,468
No
output
1
18,734
0
37,469
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ringo found a string s of length n in his [yellow submarine](https://www.youtube.com/watch?v=m2uTFF_3MaA). The string contains only lowercase letters from the English alphabet. As Ringo and his ...
instruction
0
18,735
0
37,470
No
output
1
18,735
0
37,471
Provide a correct Python 3 solution for this coding contest problem. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it ...
instruction
0
19,138
0
38,276
"Correct Solution: ``` import sys input=lambda: sys.stdin.readline().rstrip() A=input() B=input() C=input() a,b,c=len(A),len(B),len(C) def f(X,Y): XY=[True]*(10**4) x,y=len(X),len(Y) for i in range(5000-y+1,5000+x): ret=True if i<=5000: for j in range(min(x,y+i-5000)): if X[j]=="?" or Y[j-...
output
1
19,138
0
38,277
Provide a correct Python 3 solution for this coding contest problem. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it ...
instruction
0
19,139
0
38,278
"Correct Solution: ``` from itertools import chain, permutations, dropwhile from heapq import merge from functools import wraps def listify(fn): @wraps(fn) def wraper(*args, **kwargs): return list(fn(*args, **kwargs)) return wraper def comp_wild(a,b): return all(x==y or "?" in (x,y) for x,y in zip(a, b)) ...
output
1
19,139
0
38,279
Provide a correct Python 3 solution for this coding contest problem. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it ...
instruction
0
19,140
0
38,280
"Correct Solution: ``` def match(x, y): """ 1文字x, yが一致するか少なくとも一方が?であればTrueを返す。 """ return x == y or x == "?" or y == "?" def func(a, b, c, la, lb, lc): """ 文字列の並びがa->b->cの場合を仮定して考える。 aに対するb, cの配置が高々2000 * 2000通りあるので、文字列が一致するかの判定はO(1)でしないとTLE。 これは先にaとb、bとc、aとcに対して文字列の一致を前処理確認しておけばOK <= ...
output
1
19,140
0
38,281
Provide a correct Python 3 solution for this coding contest problem. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it ...
instruction
0
19,142
0
38,284
"Correct Solution: ``` from itertools import chain, permutations, dropwhile from heapq import merge from functools import wraps def comp_wild(a,b): return all(x==y or "?" in (x,y) for x,y in zip(a, b)) def listify(fn): @wraps(fn) def wraper(*args, **kwargs): return list(fn(*args, **kwargs)) return wraper ...
output
1
19,142
0
38,285
Provide a correct Python 3 solution for this coding contest problem. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it ...
instruction
0
19,143
0
38,286
"Correct Solution: ``` import sys input=lambda: sys.stdin.readline().rstrip() A=input() B=input() C=input() a,b,c=len(A),len(B),len(C) def f(X,Y): XY=[True]*(10**4) x,y=len(X),len(Y) for i in range(5000-y+1,5000+x): ret=True if i<=5000: for j in range(min(x,y+i-5000)): if X[j]=="?" or Y[j-...
output
1
19,143
0
38,287
Provide a correct Python 3 solution for this coding contest problem. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it ...
instruction
0
19,144
0
38,288
"Correct Solution: ``` R=range def F(a,b):A=len(a);r=[all([len(set([a[i+j],b[j],'?']))<3for j in R(min(A-i,len(b)))])for i in R(A)];return r+[1] def Z(X): i,j,k=X;U,V,W=M[i][j],M[j][k],M[i][k];A,B,C=map(len,[S[i]for i in X]);q=A+B+C for l in R(A+1): if U[l]: for r in R(l,A+B+1): if(B<r-l or V[r-l])*W[min(A,r...
output
1
19,144
0
38,289
Provide a correct Python 3 solution for this coding contest problem. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it ...
instruction
0
19,145
0
38,290
"Correct Solution: ``` from itertools import * from heapq import * def comp(a,b): return all(x==y or "?" in (x,y) for x,y in zip(a, b)) def comp3(a,b,c): return def comp3(i,j,k,a,b,c): m = max(i,j,k) n = min(i+len(a),j+len(b),k+len(c)) return all(len({x,y,z}-{"?"}) <= 1 for x,y,z in zip(a[m-i:n-i],b[m-j:n...
output
1
19,145
0
38,291
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). The...
instruction
0
19,146
0
38,292
Yes
output
1
19,146
0
38,293
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). The...
instruction
0
19,147
0
38,294
Yes
output
1
19,147
0
38,295
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). The...
instruction
0
19,148
0
38,296
Yes
output
1
19,148
0
38,297
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). The...
instruction
0
19,149
0
38,298
Yes
output
1
19,149
0
38,299
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). The...
instruction
0
19,150
0
38,300
No
output
1
19,150
0
38,301
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke has a string s. From this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows: * Choose a non-empty (contiguous) substring of s (possibly s itself). The...
instruction
0
19,151
0
38,302
No
output
1
19,151
0
38,303
Provide tags and a correct Python 3 solution for this coding contest problem. A non-empty string is called palindrome, if it reads the same from the left to the right and from the right to the left. For example, "abcba", "a", and "abba" are palindromes, while "abab" and "xy" are not. A string is called a substring of...
instruction
0
19,437
0
38,874
Tags: constructive algorithms, strings Correct Solution: ``` n = int(input()) s = [x for x in input().strip()] s.sort() print(*s, sep='') ```
output
1
19,437
0
38,875