You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We can split into subsegments where each subsegment, , consists of a contiguous block of characters in . Then, use each to create string such that:
6
+
7
+
# The characters in are a subsequence of the characters in .
8
+
# Any repeat occurrence of a character is removed from the string such that each character in occurs exactly once. In other words, if the character at some index in occurs at a previous index in , then do not include the character in string .
9
+
# Given and , print lines where each line denotes string .
10
+
11
+
# Input Format
12
+
13
+
# The first line contains a single string denoting .
14
+
# The second line contains an integer, , denoting the length of each subsegment.
15
+
16
+
# Constraints
17
+
18
+
# , where is the length of
19
+
# It is guaranteed that is a multiple of .
20
+
# Output Format
21
+
22
+
# Print lines where each line contains string .
23
+
24
+
# Sample Input
25
+
26
+
# AABCAAADA
27
+
# 3
28
+
# Sample Output
29
+
30
+
# AB
31
+
# CA
32
+
# AD
33
+
# Explanation
34
+
35
+
# String is split into equal parts of length . We convert each to by removing any subsequent occurrences non-distinct characters in :
0 commit comments