Skip to content

Commit

Permalink
Use less specific types
Browse files Browse the repository at this point in the history
  • Loading branch information
spannm committed Mar 23, 2024
1 parent 8c66491 commit 5fab216
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
class Problem1244 extends LeetcodeProblem {

static class Leaderboard {
private final Map<Integer, Integer> d = new HashMap<>();
private final TreeMap<Integer, Integer> rank = new TreeMap<>((a, b) -> b - a);
private final Map<Integer, Integer> d = new HashMap<>();
private final Map<Integer, Integer> rank = new TreeMap<>((a, b) -> b - a);

Leaderboard() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
class Problem1500 extends LeetcodeProblem {

static class FileSharing {
private final int chunks;
private int cur;
private final TreeSet<Integer> reused;
private final TreeMap<Integer, Set<Integer>> userChunks;
private final int chunks;
private int cur;
private final TreeSet<Integer> reused;
private final Map<Integer, Set<Integer>> userChunks;

FileSharing(int _m) {
chunks = _m;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

class Problem1656 extends LeetcodeProblem {

static class OrderedStream {
private final TreeMap<Integer, String> map;
private int ptr;
private final int limit;
private final Map<Integer, String> map;
private int ptr;
private final int limit;

OrderedStream(int _n) {
map = new TreeMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Problem2502 extends LeetcodeProblem {

static class Allocator {
private final TreeMap<Integer, Integer> tm = new TreeMap<>();
private final Map<Integer, Integer> tm = new TreeMap<>();
private final Map<Integer, List<Integer>> d = new HashMap<>();

Allocator(int n) {
Expand Down

0 comments on commit 5fab216

Please sign in to comment.