Sock merchant from hackerrank - idiomatic typescript?
Let's make it pure function:

function readLine() {
    return inputString[currentLine++];
}


IMHO both for loop should be transform to reduce, or at least the second one where you use only addition, it would be still simple and readable as a reduce().

Personally, I don't like those shorts like ws - sounds like websocket, ar and means nothing, obj and count are too generic.

result could be declared as const, as well obj and count.

And lastly, too much links as comments, why do you assume reviewer don't know TS, JS... or google? :)
Not to mention, the links could be dead soon.