2025-07-30
Today
LeetCode 3582 코드 by java
class Solution {
public String generateTag(String caption) {
String result = "#";
String[] wordArray = caption.split(" ");
for (int i = 0; i < wordArray.length; i++) {
String new_word = "";
String word = wordArray[i];
word = word.replaceAll(" ", "");
if (word == "") {
System.out.println("continue");
continue;
}
System.out.println("word : " + word);
if (result == "#") {
System.out.println("i : " + i);
new_word = word.toLowerCase();
} else {
System.out.println("i : " + i);
new_word = new_word.concat(word.substring(0, 1).toUpperCase());
new_word = new_word.concat(word.substring(1, word.length()).toLowerCase());
}
System.out.println(new_word);
result = result.concat(new_word);
if (result.length() >= 100) {
result = result.substring(0, 100);
}
}
return result;
}
}
미해결 항목
- B형 문제 풀이
TODO
- B형 문제 풀이
- 알고리즘 2문제
- Java 내용 정리