Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7762a7e

Browse files
refactor 157
1 parent fbd5892 commit 7762a7e

File tree

1 file changed

+1
-25
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+1
-25
lines changed

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

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 157. Read N Characters Given Read4
5-
*
6-
* The API: int read4(char *buf) reads 4 characters at a time from a file.
7-
*
8-
* 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.
9-
*
10-
* By using the read4 API, implement the function int read(char *buf, int n) that reads n characters from the file.
11-
*
12-
* Example 1:
13-
*
14-
* Input: buf = "abc", n = 4
15-
* Output: "abc"
16-
* Explanation: The actual number of characters read is 3, which is "abc".
17-
*
18-
* Example 2:
19-
*
20-
* Input: buf = "abcde", n = 5
21-
* Output: "abcde"
22-
*
23-
* Note:
24-
* The read function will only be called once for each test case.
25-
*
26-
*/
273
public class _157 {
284
public static class Solution1 {
295
public int read(char[] buf, int n) {
@@ -39,7 +15,7 @@ public int read(char[] buf, int n) {
3915
}
4016

4117
private int read4(char[] buffer) {
42-
//this is a fake method to make Eclipse happy
18+
//this is a dummy method to make it compile
4319
return 0;
4420
}
4521
}

0 commit comments

Comments
 (0)