Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7762a7e

Browse files
refactor 157
1 parentfbd5892 commit7762a7e

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
packagecom.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
publicclass_157 {
284
publicstaticclassSolution1 {
295
publicintread(char[]buf,intn) {
@@ -39,7 +15,7 @@ public int read(char[] buf, int n) {
3915
}
4016

4117
privateintread4(char[]buffer) {
42-
//this is afake method to makeEclipse happy
18+
//this is adummy method to makeit compile
4319
return0;
4420
}
4521
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp