Algorithm of the day #10: If you have a string like "I am the good boy". How can you generate "I ma eht doog yob"? Please note that the words are in place but reverse. #w3Develops #100DaysofCode #Tech #freeCodeCamp #Programming #Algorithms #JavaScript #CodeNewbie #AlgorithmsDaily
2
3
6
0
0
@AlgorithmsDaily let str = 'I am the good boy' let reverse = str.split(' ').map(value => value.split(' ').reverse().join(' ') console.log(reverse.join()) // ' I ma eht doog yob'
@AlgorithmsDaily @CoderNotesBot You're gonna have to do 2 splits and put them in new variables. And do a reverse on the nested ones