[Newbie Question] Help me to parse a string to int list.


[Newbie Question] Help me to parse a string to int list.

I'm trying to solve this

Firstly, I need to int list from space separated string that contains five numbers.

I think this code from template do that.

let arr = map read $ words arr_temp :: [Int]

It's working on Prelude but I got an error like this when I build my project on my local system and by Run Code on hackerrank.

The last statement in a 'do' block must be an expression let arr = map read $ words arr_temp :: [Int]

I don't know what exactly code means and error message either.

Please help!

Submitted July 18, 2017 at 08:03PM by luceat-lux-vestra
via reddit http://ift.tt/2u5Cacp

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s