File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
s1106_parsing_a_boolean_expression
s1108_defanging_an_ip_address Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 44
55import java .util .ArrayList ;
66import java .util .List ;
7+ import java .util .logging .Level ;
8+ import java .util .logging .Logger ;
79
810public class Solution {
911 private String source ;
@@ -95,6 +97,7 @@ private boolean match(char ch) {
9597
9698 private void consume (char ch , String message ) {
9799 if (!match (ch )) {
100+ Logger .getLogger (Solution .class .getName ()).log (Level .SEVERE , () -> message );
98101 return ;
99102 }
100103 advance ();
Original file line number Diff line number Diff line change 11package g1101_1200 .s1108_defanging_an_ip_address ;
22
3- // #Easy #String #2022_02_28_Time_3_ms_(26.20 %)_Space_42.8_MB_ (5.79%)
3+ // #Easy #String #2022_02_28_Time_0_ms_(100.00 %)_Space_42.6_MB_ (5.79%)
44
55public class Solution {
66 public String defangIPaddr (String address ) {
7- return address .replaceAll ( " \\ ." , "\\ [ \\ . \\ ]" );
7+ return address .replace ( " ." , "[. ]" );
88 }
99}
You can’t perform that action at this time.
0 commit comments