Skip to content

Commit

Permalink
Merge pull request #82 from AlgoLeadMe/21-wkdghdwns199
Browse files Browse the repository at this point in the history
21-wkdghdwns199
  • Loading branch information
tgyuuAn authored May 10, 2024
2 parents 5101ffe + b8eab7a commit be0f226
Show file tree
Hide file tree
Showing 25 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions wkdghdwns199/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
| 18차시 | 2024.04.03 | 집합과 맵 | <a href="https://www.acmicpc.net/problem/26069">절댓값 힙</a> | <a href="https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/73">2024.04.03</a> |
| 19차시 | 2024.04.07 | 조합론 | <a href="https://www.acmicpc.net/problem/25192">인사성 밝은 곰곰이</a> | <a href="https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/76">2024.04.07</a> |
| 20차시 | 2024.05.02 | 그리디 | <a href="https://school.programmers.co.kr/learn/courses/30/lessons/42862?itm_content=course14743">체육복</a> | <a href="">2024.05.02</a> |
| 21차시 | 2024.05.05 | 그리디 | <a href="https://school.programmers.co.kr/learn/courses/30/lessons/42860">조이스틱</a> | <a href="">2024.04.07</a> |

1 change: 1 addition & 0 deletions wkdghdwns199/tempCodeRunnerFile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

7 changes: 7 additions & 0 deletions wkdghdwns199/리뷰풀이/Java/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}
18 changes: 18 additions & 0 deletions wkdghdwns199/리뷰풀이/Java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Getting Started

Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.

## Folder Structure

The workspace contains two folders by default, where:

- `src`: the folder to maintain sources
- `lib`: the folder to maintain dependencies

Meanwhile, the compiled output files will be generated in the `bin` folder by default.

> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
## Dependency Management

The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
5 changes: 5 additions & 0 deletions wkdghdwns199/리뷰풀이/Java/src/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class App {
public static void main(String[] args) throws Exception {
System.out.println("Hello, World!");
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions wkdghdwns199/조이스틱.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

class Solution {
public int solution(String name) {
int answer=0;

int index;
int move = name.length() -1;

for (int i=0; i<name.length(); i++){
answer += Math.min(name.charAt(i) - 'A' , 'Z' - name.charAt(i) + 1);

index = i + 1;
while(index < name.length() && name.charAt(index) == 'A'){
index++;
}

move = Math.min(move, i*2+name.length()-index);
move = Math.min(move, (name.length()-index)*2+i);

}

return answer + move;
}
}

0 comments on commit be0f226

Please sign in to comment.