Question: Write a SNAP function that takes a list of mixed words and numbers and selects just the words and appends a number index in front

Write a SNAP function that takes a list of mixed words and numbers and selects just the words and appends a number index in front of the word.

For instance, if the input list is given as

Today is March 22 Wednesday day 3 of the week

The output will be:

1Today 2is 3March 4Wednesday 5day 6of 7the 8week

You are not allowed to use iteration blocks such as for or repeat but you can everything else.

Hint: you can define a global variable called index and implement a function that inserts the index in the front of the word and use this function as input to your map block.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!