Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- MVC 패턴
- spring boot
- 메가바이트스쿨
- Algorism study
- 클래스 class
- GIT
- 게시판 만들기
- AWS
- MVC
- array
- group study
- 개발자취업부트캠프
- Entity
- github
- tomcat
- side project
- Java
- View
- Sts
- Spring
- 클래스 상속
- 게시판 리뷰 만들기
- #패스트캠퍼스 #국비지원교육 #메가바이트스쿨 #MegabyteSchool #개발자취업부트캠프 #내일배움카드
- #javaStudy
- Interface
- 국비지원교육
- 내일배움카드
- crud
- 패스트캠퍼스
- MegabyteSchool
Archives
- Today
- Total
tuter77
2023.01.01 알고리즘 현재까지 한것. 본문
<프로그래머스>
- 크기가 작은 부분문자열
- 조건에 맞는 도서리스트 출력하기
- 문자열 나누기
- 햄버거 만들기
- 인기있는 아이스크림
- 흉부외과 또는 일반외과 의사 목록 출력하기
class Solution {
public static int solution(String t, String p) {
int len = p.length();
long num = Long.parseLong(p);//문자열을 Long으로 저장하는 parseLong
int answer = 0;
for (int i = 0; i <= t.length() - len; i++) {
if (Long.parseLong(t.substring(i, i + len)) <= num) {//문자열 잘라서 꺼내는 substring(시작, 끝)
answer++;//p자리만큼의 t의 값이 p의 길이보다 같거나 작으면 answer를 증가.
}
}
return answer;
}
}
SELECT book_id, date_format(PUBLISHED_DATE, '%Y-%m-%d') as PUBLISHED_DATE
from book
where category = '인문'
and date_format(PUBLISHED_DATE, '%Y') = '2021'
order by PUBLISHED_DATE asc
class Solution {
public int solution(String s) {
int answer = 0;
while (s.length() != 0) {
answer++;
char ch = s.charAt(0);
int sCount = 1;
int dCount = 0;
for (int i = 1; i < s.length(); i++) {
if (ch == s.charAt(i))
sCount++;
else
dCount++;
if (sCount == dCount)
break;
}
s = s.substring(sCount + dCount);
}
return answer;
}
}
import java.util.*;
class Solution {
public int solution(int[] ingredient) {
int answer = 0;
int[] arr = new int []{1,2,3,1};
ArrayList<Integer> checkList = new ArrayList<>();
for(int i = 0; i<ingredient.length; i++){
checkList.add(ingredient[i]);
if (checkList.size() >=4){
int[] temp = new int[4];
temp[0] = checkList.get(checkList.size() - 4 );
temp[1] = checkList.get(checkList.size() - 3 );
temp[2] = checkList.get(checkList.size() - 2 );
temp[3] = checkList.get(checkList.size() - 1 );
if(Arrays.equals(temp, arr)){
answer++;
checkList.remove(checkList.size() - 1);
checkList.remove(checkList.size() - 1);
checkList.remove(checkList.size() - 1);
checkList.remove(checkList.size() - 1);
}
}
}
return answer;
}
}
SELECT FLAVOR
from first_half
order by total_order desc, shipment_id asc
SELECT DR_NAME, DR_ID, MCDP_CD, date_format(HIRE_YMD, '%Y-%m-%d') as HIRE_YMD
from doctor
where MCDP_CD = "cs" or MCDP_CD = "gs"
order by hire_ymd desc, dr_name asc'Algorism TIL' 카테고리의 다른 글
| 자료구조/알고리즘 시간복잡도 (1) | 2023.02.10 |
|---|---|
| 자료구조/알고리즘 자바의 데이터 표현. (0) | 2023.02.10 |
| 2022.12.23 프로그래머스 (0) | 2022.12.23 |
| 22.12.21 TIL(백준 입출력) (0) | 2022.12.21 |