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

Commit92ad82f

Browse files
add 1756
1 parent71c056e commit92ad82f

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ _If you like this project, please leave me a star._ ★
1717
|1763|[Longest Nice Substring](https://leetcode.com/problems/longest-nice-substring/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1763.java)||Easy|String|
1818
|1759|[Count Number of Homogenous Substrings](https://leetcode.com/problems/count-number-of-homogenous-substrings/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1758.java)||Medium|String ,Greedy|
1919
|1758|[Minimum Changes To Make Alternating Binary String](https://leetcode.com/problems/minimum-changes-to-make-alternating-binary-string/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1758.java)||Easy|Greedy, Array|
20+
|1756|[Design Most Recently Used Queue](https://leetcode.com/problems/design-most-recently-used-queue/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1756.java)||Medium|Array, Design, Dequeue|
2021
|1754|[Largest Merge Of Two Strings](https://leetcode.com/problems/largest-merge-of-two-strings/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1753.java)||Medium|Greedy, Suffix Array|
2122
|1753|[Maximum Score From Removing Stones](https://leetcode.com/problems/maximum-score-from-removing-stones/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1753.java)||Medium|Math, Heap|
2223
|1752|[Check if Array Is Sorted and Rotated](https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1752.java)||Easy|Array|
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
packagecom.fishercoder.solutions;
2+
3+
importjava.util.ArrayList;
4+
importjava.util.List;
5+
6+
publicclass_1756 {
7+
publicstaticclassSolution1 {
8+
classMRUQueue {
9+
List<Integer>list;
10+
11+
publicMRUQueue(intn) {
12+
list =newArrayList(n);
13+
for (inti =1;i <=n;i++) {
14+
list.add(i);
15+
}
16+
}
17+
18+
publicintfetch(intk) {
19+
intfetched =list.remove(k -1);
20+
list.add(fetched);
21+
returnfetched;
22+
}
23+
}
24+
25+
}
26+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp