Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/randhir200/string-modification-iii

You are given a string, whose length is stored in a variable with the nameN The string is stored in a variable with the namestr It is given that the length of the string is always divisible by 3 You have to create a new modified string, such that individual parts of the original string of length 3, are reversed For example, consider the given string isstr = abcdefghi, andN = 9. In this case, there are 3 parts of the string with length 3 The first part isabc, the second part isdef, and the third part isghi. Now, you have to reverse all the three parts, and combine them in the same order as before Therefore, the first part after reversing iscba, second part after reversing isfed, and the third part after reversing isihg Combining the three parts, the new modified string becomescbafedihg, which is the required answer
https://github.com/randhir200/string-modification-iii

Last synced: 2 days ago
JSON representation

You are given a string, whose length is stored in a variable with the nameN The string is stored in a variable with the namestr It is given that the length of the string is always divisible by 3 You have to create a new modified string, such that individual parts of the original string of length 3, are reversed For example, consider the given string isstr = abcdefghi, andN = 9. In this case, there are 3 parts of the string with length 3 The first part isabc, the second part isdef, and the third part isghi. Now, you have to reverse all the three parts, and combine them in the same order as before Therefore, the first part after reversing iscba, second part after reversing isfed, and the third part after reversing isihg Combining the three parts, the new modified string becomescbafedihg, which is the required answer

Awesome Lists containing this project