8000 update 791 · githubniraj/Leetcode@7b51f0b · GitHub
[go: up one dir, main page]

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

Appearance settings

Commit 7b51f0b

Browse files
update 791
1 parent ed07b96 commit 7b51f0b

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/main/java/com/fishercoder/solutions/_791.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
public class _791 {
77
public static class Solution1 {
8-
public String customSortString(String S, String T) {
8+
public String customSortString(String order, String s) {
99
Map<Character, Integer> map = new HashMap<>();
10-
for (char c : T.toCharArray()) {
10+
for (char c : s.toCharArray()) {
1111
map.put(c, map.getOrDefault(c, 0) + 1);
1212
}
1313
StringBuilder sb = new StringBuilder();
14-
for (char c : S.toCharArray()) {
14+
for (char c : order.toCharArray()) {
1515
if (map.containsKey(c)) {
1616
int count = map.get(c);
1717
while (count-- > 0) {
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
package com.fishercoder;
22

33
import com.fishercoder.solutions._791;
4-
import org.junit.BeforeClass;
5-
import org.junit.Test;
4+
import org.junit.jupiter.api.BeforeEach;
5+
import org.junit.jupiter.api.Test;
66

7-
import static org.junit.Assert.assertEquals;
7+
import static org.junit.jupiter.api.Assertions.assertEquals;
88

99
public class _791Test {
10-
private static _791.Solution1 solution1;
10+
private static _791.Solution1 solution1;
1111

12-
@BeforeClass
13-
public static void setup() {
14-
solution1 = new _791.Solution1();
15-
}
12+
@BeforeEach
13+
public void setup() {
14+
solution1 = new _791.Solution1();
15+
}
1616

17-
@Test
18-
public void test1() {
19-
assertEquals("cbad", solution1.customSortString("cba", "abcd"));
20-
}
17+
@Test
18+
public void test1() {
19+
assertEquals("cbad", solution1.customSortString("cba", "abcd"));
20+
}
2121
}

0 commit comments

Comments
 (0)
0