Search
⌘K

Leetcode 157. Read N Characters Given Read4

Given an API read4 that reads up to 4 characters from a file into a temporary buffer, implement read(buf, n) to copy up to n characters into the destination buffer using repeated read4 calls, correctly handling partial reads at EOF and returning the actual number of characters read.

Asked at:

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late December, 2024

Google

Google

Mid-level

Read N Characters Given Read4

Mid September, 2024

Google

Google

Mid-level

Implement a problem similar to the Read-nSize() buffer question

Comments

Your account is free and you can post anonymously if you choose.