Skip to main content
Commonmark migration
Source Link

#Pyth, 27 26 bytes

Pyth, 27 26 bytes

&zhfTmf!/>zhxzYYm<>zkdUzUz

Try it here.

Note that due to a bug in the online compiler, the empty string case only works correctly on the command line version, which can be found here.

You can also cure the bug by giving a newline as the input for the online compiler.

Explanation:

                                   z = input(), implicit.
&z                                 Prints empty string if input is empty.
  hfT                              Take the first non-empty list from
     m                  Uz         A list of list of substrings of z, divided by length
                m<>zkdUz           with some shorter strings repeated later, to no effect.
      f                            Where the substrings are filtered on
       !/      Y                   There being 0 occurrences of the substring in
         >z                        The slice of z
           hxzY                    from the character after the first character
                                   of the first occurrence of the substring in z
                                   to the end of z.

#Pyth, 27 26 bytes

&zhfTmf!/>zhxzYYm<>zkdUzUz

Try it here.

Note that due to a bug in the online compiler, the empty string case only works correctly on the command line version, which can be found here.

You can also cure the bug by giving a newline as the input for the online compiler.

Explanation:

                                   z = input(), implicit.
&z                                 Prints empty string if input is empty.
  hfT                              Take the first non-empty list from
     m                  Uz         A list of list of substrings of z, divided by length
                m<>zkdUz           with some shorter strings repeated later, to no effect.
      f                            Where the substrings are filtered on
       !/      Y                   There being 0 occurrences of the substring in
         >z                        The slice of z
           hxzY                    from the character after the first character
                                   of the first occurrence of the substring in z
                                   to the end of z.

Pyth, 27 26 bytes

&zhfTmf!/>zhxzYYm<>zkdUzUz

Try it here.

Note that due to a bug in the online compiler, the empty string case only works correctly on the command line version, which can be found here.

You can also cure the bug by giving a newline as the input for the online compiler.

Explanation:

                                   z = input(), implicit.
&z                                 Prints empty string if input is empty.
  hfT                              Take the first non-empty list from
     m                  Uz         A list of list of substrings of z, divided by length
                m<>zkdUz           with some shorter strings repeated later, to no effect.
      f                            Where the substrings are filtered on
       !/      Y                   There being 0 occurrences of the substring in
         >z                        The slice of z
           hxzY                    from the character after the first character
                                   of the first occurrence of the substring in z
                                   to the end of z.
added 961 characters in body
Source Link
isaacg
  • 42.1k
  • 5
  • 73
  • 213

#Pyth, 27 26 bytes

&zhfTmf!/>zhxzYYm<>zkdUzUz

Try it here.

Note that due to a bug in the online compiler, the empty string case only works correctly on the command line version, which can be found here.

You can also cure the bug by giving a newline as the input for the online compiler.

Explanation:

                                   z = input(), implicit.
&z                                 Prints empty string if input is empty.
  hfT                              Take the first non-empty list from
     m                  Uz         A list of list of substrings of z, divided by length
                m<>zkdUz           with some shorter strings repeated later, to no effect.
      f                            Where the substrings are filtered on
       !/      Y                   There being 0 occurrences of the substring in
         >z                        The slice of z
           hxzY                    from the character after the first character
                                   of the first occurrence of the substring in z
                                   to the end of z.

#Pyth, 27 26 bytes

&zhfTmf!/>zhxzYYm<>zkdUzUz

Try it here.

Note that due to a bug in the online compiler, the empty string case only works correctly on the command line version, which can be found here.

#Pyth, 27 26 bytes

&zhfTmf!/>zhxzYYm<>zkdUzUz

Try it here.

Note that due to a bug in the online compiler, the empty string case only works correctly on the command line version, which can be found here.

You can also cure the bug by giving a newline as the input for the online compiler.

Explanation:

                                   z = input(), implicit.
&z                                 Prints empty string if input is empty.
  hfT                              Take the first non-empty list from
     m                  Uz         A list of list of substrings of z, divided by length
                m<>zkdUz           with some shorter strings repeated later, to no effect.
      f                            Where the substrings are filtered on
       !/      Y                   There being 0 occurrences of the substring in
         >z                        The slice of z
           hxzY                    from the character after the first character
                                   of the first occurrence of the substring in z
                                   to the end of z.
added 175 characters in body
Source Link
isaacg
  • 42.1k
  • 5
  • 73
  • 213

#Pyth, 27 26 bytes

&zhfTmf!/>zhxzYYm<>zkdUzUz

Try it here.

ExplanationNote that due to follow.a bug in the online compiler, the empty string case only works correctly on the command line version, which can be found here.

#Pyth, 27 26 bytes

&zhfTmf!/>zhxzYYm<>zkdUzUz

Try it here.

Explanation to follow.

#Pyth, 27 26 bytes

&zhfTmf!/>zhxzYYm<>zkdUzUz

Try it here.

Note that due to a bug in the online compiler, the empty string case only works correctly on the command line version, which can be found here.

added 15 characters in body
Source Link
isaacg
  • 42.1k
  • 5
  • 73
  • 213
Loading
Source Link
isaacg
  • 42.1k
  • 5
  • 73
  • 213
Loading