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

Commit0d8050e

Browse files
refactor 158
1 parent7762a7e commit0d8050e

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
11
packagecom.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
publicclass_158 {
254

265
publicstaticclassSolution1 {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp