Skip to content

Latest commit

 

History

History
 
 

isTandemRepeat

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Check Out My YouTube Channel

Algorithm Challenge Available At CodeFights

Determine whether the given string can be obtained by one concatenation of some string to itself.

Example

  • For inputString = "tandemtandem", the output should be isTandemRepeat(inputString) = true;
  • For inputString = "qqq", the output should be isTandemRepeat(inputString) = false;
  • For inputString = "2w2ww", the output should be isTandemRepeat(inputString) = false.

Hints

  • slice()

Input/Output

  • [time limit] 4000ms (js)
  • [input] string inputString

Guaranteed constraints:

2 ≤ inputString.length ≤ 20

  • [output] boolean

true if inputString represents a string concatenated to itself, false otherwise.