Skip to content

Commit 0d8050e

Browse files
refactor 158
1 parent 7762a7e commit 0d8050e

File tree

1 file changed

+0
-21
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-21
lines changed

src/main/java/com/fishercoder/solutions/_158.java

-21
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 158. Read N Characters Given Read4 II - Call multiple times
5-
*
6-
* The API: int read4(char *buf) reads 4 characters at a time from a file.
7-
* The return value is the actual number of characters read. For example, it returns 3 if there is only 3 characters left in the file.
8-
* By using the read4 API, implement the function int read(char *buf, int n) that reads n characters from the file.
9-
*
10-
* Note:
11-
* The read function may be called multiple times.
12-
*
13-
* Example 1:
14-
* Given buf = "abc"
15-
* read("abc", 1) // returns "a"
16-
* read("abc", 2); // returns "bc"
17-
* read("abc", 1); // returns ""
18-
*
19-
* Example 2:
20-
* Given buf = "abc"
21-
* read("abc", 4) // returns "abc"
22-
* read("abc", 1); // returns ""
23-
*/
243
public class _158 {
254

265
public static class Solution1 {

0 commit comments

Comments
 (0)