LC: 157. Read N Characters Given Read4 - spiralgo/algorithms GitHub Wiki
157. Read N Characters Given Read4:
The Essence:
The aim of the problem is to teach how to use an Interface.
So pay attention to that we don't have direct access to the array but we can only reach using a given interface.
Details:
Therefore it would be great the problem-solver is informed about Interfaces in the programming language of choice. We should call read4(buf4); in a while loop either with or without a buffer array. The problem-solver can find both of the implementations here: https://github.com/spiralgo/algorithms/blob/master/src/main/java/algorithms/curated170/easy/ReadNCharactersGivenRead4.java