Skip to content

Commit 4c9c1af

Browse files
add 3114
1 parent b3ada51 commit 4c9c1af

File tree

2 files changed

+31
-0
lines changed
  • paginated_contents/algorithms/4th_thousand
  • src/main/java/com/fishercoder/solutions/fourththousand

2 files changed

+31
-0
lines changed

Diff for: paginated_contents/algorithms/4th_thousand/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
| 3131 | [Find the Integer Added to Array I](https://leetcode.com/problems/find-the-integer-added-to-array-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3131.java) | | Easy |
4646
| 3127 | [Make a Square with the Same Color](https://leetcode.com/problems/make-a-square-with-the-same-color/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3127.java) | | Easy |
4747
| 3120 | [Count the Number of Special Characters I](https://leetcode.com/problems/count-the-number-of-special-characters-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3120.java) | | Easy |
48+
| 3114 | [Latest Time You Can Obtain After Replacing Characters](https://leetcode.com/problems/latest-time-you-can-obtain-after-replacing-characters/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3114.java) | | Easy |
4849
| 3112 | [Minimum Time to Visit Disappearing Nodes](https://leetcode.com/problems/minimum-time-to-visit-disappearing-nodes/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3112.java) | | Medium | Graph, Shortest Path
4950
| 3110 | [Score of a String](https://leetcode.com/problems/score-of-a-string/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3110.java) | | Easy |
5051
| 3095 | [Shortest Subarray With OR at Least K I](https://leetcode.com/problems/shortest-subarray-with-or-at-least-k-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3095.java) | | Easy |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.fishercoder.solutions.fourththousand;
2+
3+
public class _3114 {
4+
public static class Solution1 {
5+
public String findLatestTime(String s) {
6+
char[] arr = s.toCharArray();
7+
if (arr[0] == '?') {
8+
if (arr[1] == '?' || arr[1] == '0' || arr[1] == '1') {
9+
arr[0] = '1';
10+
} else {
11+
arr[0] = '0';
12+
}
13+
}
14+
if (arr[1] == '?') {
15+
if (arr[0] == '1') {
16+
arr[1] = '1';
17+
} else {
18+
arr[1] = '9';
19+
}
20+
}
21+
if (arr[3] == '?') {
22+
arr[3] = '5';
23+
}
24+
if (arr[4] == '?') {
25+
arr[4] = '9';
26+
}
27+
return new String(arr);
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)