Skip to content

Commit 5dd6f6d

Browse files
add 1844
1 parent 4be926f commit 5dd6f6d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|-----|----------------|---------------|--------|-------------|-------------
11+
|1844|[Replace All Digits with Characters](https://leetcode.com/problems/replace-all-digits-with-characters//)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1844.java) ||Easy|String|
1112
|1837|[Sum of Digits in Base K](https://leetcode.com/problems/sum-of-digits-in-base-k/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1837.java) ||Easy|Math, Bit Manipulation|
1213
|1833|[Maximum Ice Cream Bars](https://leetcode.com/problems/maximum-ice-cream-bars/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1833.java) ||Medium|Array, Sort|
1314
|1832|[Check if the Sentence Is Pangram](https://leetcode.com/problems/check-if-the-sentence-is-pangram/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1832.java) ||Easy|String|
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _1844 {
4+
public static class Soluiton1 {
5+
public String replaceDigits(String s) {
6+
StringBuilder sb = new StringBuilder();
7+
for (char c : s.toCharArray()) {
8+
if (Character.isAlphabetic(c)) {
9+
sb.append(c);
10+
} else {
11+
sb.append((char) (sb.charAt(sb.length() - 1) + Character.getNumericValue(c)));
12+
}
13+
}
14+
return sb.toString();
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy