Skip to main content
deleted 20 characters in body
Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 394

05AB1E, 10 10 9 bytes

gLā.Δõs<ǝÂQ 

Try it onlineTry it online or verify some more test casesverify some more test cases.

Explanation:

g # Get the length of the (implicit) input-string Lā # CreatePush a list in the range [1, (implicit) input-length]   .Δ # FindPop and find the first value in this list which is truthy for:   # (which will outputresult in -1 if none are truthy)   õ # Push an empty string ""   s # Swap to get the current integer of the find_first-loop   < # Decrease it by 1 because 05AB1E hasuses 0-based indexing   ǝ # In the (implicit) input-String, replace the character at that index with   # the empty string ""   Â # Then bifurcate the string (short for Duplicate & Reverse copy)   Q # And check if the reversed copy is equal to the original string,   # So(so `ÂQ` basically checks if a string is a palindrome)   # (after which the result is output implicitly) 

05AB1E, 10 bytes

gL.Δõs<ǝÂQ 

Try it online or verify some more test cases.

Explanation:

g # Get the length of the (implicit) input-string L # Create a list in the range [1,length]   .Δ # Find the first value in this list which is truthy for:   # (which will output -1 if none are truthy)   õ # Push an empty string ""   s # Swap to get the current integer of the find_first-loop   < # Decrease it by 1 because 05AB1E has 0-based indexing   ǝ # In the (implicit) input-String, replace the character at that index with   # the empty string ""   Â # Then bifurcate the string (short for Duplicate & Reverse copy)   Q # And check if the reversed copy is equal to the original string,   # So `ÂQ` basically checks if a string is a palindrome)   # (after which the result is output implicitly) 

05AB1E, 10 9 bytes

ā.Δõs<ǝÂQ 

Try it online or verify some more test cases.

Explanation:

ā # Push a list in the range [1, (implicit) input-length] .Δ # Pop and find the first value in this list which is truthy for: # (which will result in -1 if none are truthy) õ # Push an empty string "" s # Swap to get the current integer of the find_first-loop < # Decrease it by 1 because 05AB1E uses 0-based indexing ǝ # In the (implicit) input-String, replace the character at that index with # the empty string "" Â # Then bifurcate the string (short for Duplicate & Reverse copy) Q # And check if the reversed copy is equal to the original string # (so `ÂQ` basically checks if a string is a palindrome) # (after which the result is output implicitly) 
Commonmark migration
Source Link

#05AB1E, 10 bytes

05AB1E, 10 bytes

gL.Δõs<ǝÂQ 

Try it online or verify some more test cases.

Explanation:

g # Get the length of the (implicit) input-string L # Create a list in the range [1,length] .Δ # Find the first value in this list which is truthy for: # (which will output -1 if none are truthy) õ # Push an empty string "" s # Swap to get the current integer of the find_first-loop < # Decrease it by 1 because 05AB1E has 0-based indexing ǝ # In the (implicit) input-String, replace the character at that index with # the empty string "" Â # Then bifurcate the string (short for Duplicate & Reverse copy) Q # And check if the reversed copy is equal to the original string, # So `ÂQ` basically checks if a string is a palindrome) # (after which the result is output implicitly) 

#05AB1E, 10 bytes

gL.Δõs<ǝÂQ 

Try it online or verify some more test cases.

Explanation:

g # Get the length of the (implicit) input-string L # Create a list in the range [1,length] .Δ # Find the first value in this list which is truthy for: # (which will output -1 if none are truthy) õ # Push an empty string "" s # Swap to get the current integer of the find_first-loop < # Decrease it by 1 because 05AB1E has 0-based indexing ǝ # In the (implicit) input-String, replace the character at that index with # the empty string "" Â # Then bifurcate the string (short for Duplicate & Reverse copy) Q # And check if the reversed copy is equal to the original string, # So `ÂQ` basically checks if a string is a palindrome) # (after which the result is output implicitly) 

05AB1E, 10 bytes

gL.Δõs<ǝÂQ 

Try it online or verify some more test cases.

Explanation:

g # Get the length of the (implicit) input-string L # Create a list in the range [1,length] .Δ # Find the first value in this list which is truthy for: # (which will output -1 if none are truthy) õ # Push an empty string "" s # Swap to get the current integer of the find_first-loop < # Decrease it by 1 because 05AB1E has 0-based indexing ǝ # In the (implicit) input-String, replace the character at that index with # the empty string "" Â # Then bifurcate the string (short for Duplicate & Reverse copy) Q # And check if the reversed copy is equal to the original string, # So `ÂQ` basically checks if a string is a palindrome) # (after which the result is output implicitly) 
Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 394

#05AB1E, 10 bytes

gL.Δõs<ǝÂQ 

Try it online or verify some more test cases.

Explanation:

g # Get the length of the (implicit) input-string L # Create a list in the range [1,length] .Δ # Find the first value in this list which is truthy for: # (which will output -1 if none are truthy) õ # Push an empty string "" s # Swap to get the current integer of the find_first-loop < # Decrease it by 1 because 05AB1E has 0-based indexing ǝ # In the (implicit) input-String, replace the character at that index with # the empty string "" Â # Then bifurcate the string (short for Duplicate & Reverse copy) Q # And check if the reversed copy is equal to the original string, # So `ÂQ` basically checks if a string is a palindrome) # (after which the result is output implicitly)