Skip to content

Commit 0207267

Browse files
refactor 555
1 parent d838d7f commit 0207267

File tree

1 file changed

+0
-31
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-31
lines changed

src/main/java/com/fishercoder/solutions/_555.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 555. Split Concatenated Strings
5-
*
6-
* Given a list of strings, you could concatenate these strings together into a loop,
7-
* where for each string you could choose to reverse it or not.
8-
*
9-
* Among all the possible loops, you need to find the lexicographically biggest string after cutting the loop,
10-
* which will make the looped string into a regular one.
11-
*
12-
* Specifically, to find the lexicographically biggest string, you need to experience two phases:
13-
*
14-
* 1. Concatenate all the strings into a loop, where you can reverse some strings or not and connect them in the same order as given.
15-
* 2. Cut and make one breakpoint in any place of the loop, which will make the looped string into a regular one starting from
16-
* the character at the cutpoint.
17-
*
18-
* And your job is to find the lexicographically biggest one among all the possible regular strings.
19-
20-
Example:
21-
Input: "abc", "xyz"
22-
Output: "zyxcba"
23-
24-
Explanation: You can get the looped string "-abcxyz-", "-abczyx-", "-cbaxyz-", "-cbazyx-",
25-
where '-' represents the looped status.
26-
The answer string came from the fourth looped one,
27-
where you could cut from the middle character 'a' and get "zyxcba".
28-
29-
Note:
30-
The input strings will only contain lowercase letters.
31-
The total length of all the strings will not over 1,000.
32-
33-
*/
343
public class _555 {
354

365
public static class Solution1 {

0 commit comments

Comments
 (0)