Qualcomm interview question

Reverse a string

Interview Answers

Anonymous

Dec 27, 2014

Solution in python: x = "String to be reversed" n = "" for m in range(len(x)): n = n + x[len(x) - m - 1]

2

Anonymous

Dec 14, 2014

Apache Commons lang: StringUtils.reverse("String to be reversed");

1

Anonymous

May 23, 2015

void reverseString(char *str){ char * end; char temp; if(str){ while(*end){ ++end; } end--; while(str

1

Anonymous

Jan 17, 2018

string[::-1]