Test cases failing


in the following code first three test cases are failing.

@akshatkaush
hello Akshat,
for input -> aaaaa
output should be -> a

but urs is giving -> aaa

now this is only running for same characters, for different characters it is showing time limit exceeded.

@akshatkaush
hello Akshat,
pls check this -> https://ide.codingblocks.com/s/209954

a) i have added on more base case i.e if len==0 then retunr ;

b) image

c) image
u were iterating from i=1

1 Like