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
- 타입스크립트
- CS
- 백준18111번js
- 깃허브
- 브랜치
- 객체
- 좋아요추가
- Express
- 리액트
- 백준13549번js
- Node.js
- 자바스크립트
- 백준18111번
- 웹
- 백준13549번
- 깃
- post
- API
- 프로그래머스
- 오픈소스
- 변수
- 컴퓨터공학
- 예외처리
- 데이터베이스
- 자바
- npm
- 리팩토링
- gui
- 파이프라인
- js
Archives
- Today
- Total
목록프로그래머스다음큰숫자java (1)
Nevertheless

class Solution { static String binary; static int count_1; static int count_1(int num){ binary=Integer.toBinaryString(num); binary=binary.replace("0",""); //0을 제거하기 count_1=binary.length(); //1만 남았으므로 1의 개수==문자열의 길이 return count_1; // 개수 반환 } public int solution(int n) { int answer = 0; int num=count_1(n); // n의 1의 개수 세기 for(int i=n+1;i 1만 남음 3. 문자열의 길이 (1의 개수) 를 반환한다. - main : n의 1의 개수를 ..
코딩테스트/Programmers
2024. 4. 22. 20:47