File tree 2 files changed +15
-15
lines changed
main/java/com/fishercoder/solutions
test/java/com/fishercoder
2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 5
5
6
6
public class _791 {
7
7
public static class Solution1 {
8
- public String customSortString (String S , String T ) {
8
+ public String customSortString (String order , String s ) {
9
9
Map <Character , Integer > map = new HashMap <>();
10
- for (char c : T .toCharArray ()) {
10
+ for (char c : s .toCharArray ()) {
11
11
map .put (c , map .getOrDefault (c , 0 ) + 1 );
12
12
}
13
13
StringBuilder sb = new StringBuilder ();
14
- for (char c : S .toCharArray ()) {
14
+ for (char c : order .toCharArray ()) {
15
15
if (map .containsKey (c )) {
16
16
int count = map .get (c );
17
17
while (count -- > 0 ) {
Original file line number Diff line number Diff line change 1
1
package com .fishercoder ;
2
2
3
3
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 ;
6
6
7
- import static org .junit .Assert .assertEquals ;
7
+ import static org .junit .jupiter . api . Assertions .assertEquals ;
8
8
9
9
public class _791Test {
10
- private static _791 .Solution1 solution1 ;
10
+ private static _791 .Solution1 solution1 ;
11
11
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
+ }
16
16
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
+ }
21
21
}
You can’t perform that action at this time.
0 commit comments