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
- 0으로 채우기
- 프로그래머스 네트워크 java
- Codility
- 프로그래머스 옹알이 java
- Math.ceil()
- java
- mysql
- java 올림
- 프로그래머스 도둑질 java
- 백준 16927
- 알고리즘
- 백준 14391
- 네트워크
- Math.floor()
- Algorithm
- 프로그래머스 숫자의 표현 java
- 프로그래머스 연속된 수의 합 java
- 백준 16935
- java 내림
- sort
- 백준 15661
- 백준 11723
- 자바
- java 반올림
- time complexity
- 백준 4375
- 백준 18290
- 백준 17425
- Arrays
- 코딩테스트
Archives
- Today
- Total
목록분류 전체보기 (151)
취미처럼
[Codility] Lesson 1. Iterations - BinaryGap
2진수의 1과 1사이의 간격 중 가장 큰 값을 찾는 문제 public static int solution(int N) { String str = Integer.toBinaryString(N); String[] arr = str.split(""); int totalGapLength = 0; int gapLength = 0; for (int i = 0; i totalGapLength) { totalGapLength = gapLength; } gapLength = 0; } else if(arr[i].equals("0")) { gapLength++; } } return totalGapLength; }
Algorithm/Codility
2020. 2. 19. 21:44