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

Commit0f058e0

Browse files
authored
Update readme.md
1 parent4b7550c commit0f058e0

File tree

1 file changed

+3
-5
lines changed
  • src/main/java/g0301_0400/s0381_insert_delete_getrandom_o1_duplicates_allowed

1 file changed

+3
-5
lines changed

‎src/main/java/g0301_0400/s0381_insert_delete_getrandom_o1_duplicates_allowed/readme.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,17 @@ You must implement the functions of the class such that each function works on *
2222
["RandomizedCollection", "insert", "insert", "insert", "getRandom", "remove", "getRandom"]
2323
[[], [1], [1], [2], [], [1], []]
2424

25-
**Output:**
26-
27-
[null, true, false, true, 2, true, 1]
25+
**Output:**\[null, true, false, true, 2, true, 1\]
2826

2927
**Explanation:**
3028

3129
RandomizedCollection randomizedCollection = new RandomizedCollection();
3230
randomizedCollection.insert(1); // return true since the collection does not contain 1.
3331
// Inserts 1 into the collection.
3432
randomizedCollection.insert(1); // return false since the collection contains 1.
35-
// Inserts another 1 into the collection. Collection now contains\[1,1\].
33+
// Inserts another 1 into the collection. Collection now contains [1,1].
3634
randomizedCollection.insert(2); // return true since the collection does not contain 2.
37-
// Inserts 2 into the collection. Collection now contains\[1,1,2\].
35+
// Inserts 2 into the collection. Collection now contains [1,1,2].
3836
randomizedCollection.getRandom(); // getRandom should:
3937
// - return 1 with probability 2/3, or
4038
// - return 2 with probability 1/3.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp