We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
For n times read another number from input called q and read the next q lines with getMultipleLines. It returns a list of q lines as strings.
To parse the numbers inside a single line, use list comprehension to iterate on the lines and the function "words" to split the values. This code works if every line contains exactly two integers and put them in a list of type [(Int, Int)]
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Functions or Not?
You are viewing a single comment's thread. Return to all comments →
use this as pattern for IO:
It works with most input format of HackerRank: