Jev Log

고정 헤더 영역

글 제목

메뉴 레이어

Jev Log

메뉴 리스트

  • 홈
  • 방명록
  • 분류 전체보기 (68)
    • Development (68)
      • PHP (2)
      • Apache (2)
      • Tomcat (1)
      • Linux (4)
      • Elastic Search(엘라스틱서치) (4)
      • Java (3)
      • JavaScript (7)
      • Spring (11)
      • ASP (1)
      • Oracle (1)
      • MY-SQL (1)
      • Vue JS (0)
      • 쿠버네티스 (2)
      • AWS (3)
      • 테라폼 (9)
      • ETC (4)
      • 하이퍼레저 패브릭 (4)
      • 알고리즘 (9)

검색 레이어

Jev Log

검색 영역

컨텐츠 검색

codility

  • [Codility] MaxCounters

    2020.06.28 by J-Developer

  • [codility] FrogRiverOne

    2020.06.28 by J-Developer

  • [Codility] TapeEquilibrium

    2020.06.28 by J-Developer

  • [Codility]PermMissingElem

    2020.06.28 by J-Developer

  • [Codility]FrogJmp

    2020.06.27 by J-Developer

  • [Codility]CyclicRotation

    2020.06.27 by J-Developer

  • [Codility]BinaryGap

    2020.06.27 by J-Developer

[Codility] MaxCounters

[문제] [답안작성] - 시간복잡도 : O(N*M) class Solution { public int[] solution(int N, int[] A) { int[] resultArr = new int[N]; for( int a : A ) { if( a > N ) { int[] tempArr = resultArr.clone(); Arrays.sort( tempArr ); for( int i = 0; i < N; i++ ) { resultArr[i] = tempArr[N - 1]; } } else { ++resultArr[a - 1]; } } return resultArr; } } [다른 답안 작성] - 시간복잡도 : O(N*M) (Score 66%) class Solution { public int[] s..

Development/알고리즘 2020. 6. 28. 14:38

[codility] FrogRiverOne

[문제] [답안작성] class Solution { public int solution(int X, int[] A) { boolean[] isSuccess = new boolean[X]; int point = 0; for( int i = 0; i < A.length; i++ ) { if( A[i]

Development/알고리즘 2020. 6. 28. 13:45

[Codility] TapeEquilibrium

[문제] [답안작성] class Solution { public int solution(int[] A) { // write your code in Java SE 8 int leftSum = 0; int rightSum = 0; int result = Integer.MAX_VALUE; int total = 0; for( int a : A ) { total += a; } for( int i = 0; i temp ) { result = temp; } } return result; } }

Development/알고리즘 2020. 6. 28. 12:36

[Codility]PermMissingElem

[문제] [답안작성] class Solution { public int solution(int[] A) { int result = 0; for( int i = 1; i a == j ) ) { result = i; break; } } if( result == 0 ) { result = 100001; } return result; } } [위의 답안은 느려서 다른 답안으로 변경] class Solution { public int solution(int[] A) { Arrays.sort(A); int result = 0; for( int i = 1; i

Development/알고리즘 2020. 6. 28. 11:52

[Codility]FrogJmp

[문제] [답안작성] class Solution { public int solution(int X, int Y, int D) { if( X == Y ) { return 0; } return (int) Math.ceil( ( Y - X ) / (double) D ); } }

Development/알고리즘 2020. 6. 27. 19:34

[Codility]CyclicRotation

[문제] [답안작성] class Solution { public int[] solution(int[] A, int K) { if( A.length == K || A.length == 1 || A.length == 0 ) { return A; } int temp = 0; for( int i = 0; i < K; i++ ) { for( int j = 0; j < A.length; j++ ) { int t = 0; if( j == A.length - 1 ) { A[0] = A[j]; A[j] = temp; } else { t = A[j]; A[j] = temp; temp = t; } } } return A; } }

Development/알고리즘 2020. 6. 27. 17:10

[Codility]BinaryGap

[문제] [답안 작성] class Solution { public int solution(int N) { String binaryString = Integer.toBinaryString(1073741825); char[] binaryChar = binaryString.toCharArray(); boolean firstOne = false; int result = 0; int tempNum = 0; for( char c : binaryChar ) { if( c == '1' && firstOne && tempNum == 0 ) { firstOne = false; } if( c == '1' && !firstOne ) { firstOne = true; } else if( c == '1' && firstOne )..

Development/알고리즘 2020. 6. 27. 16:52

추가 정보

인기글

최신글

페이징

이전
1
다음
TISTORY
Jev Log © Magazine Lab
페이스북 트위터 인스타그램 유투브 메일

티스토리툴바