[자바JAVA]Sherlock and Squares 해커랭크

Sherlock and Squares

주어진 수의 범위 안의 제곱근(square integer)의 갯수를 구하는 문제이다.
Watson likes to challenge Sherlock’s math ability. He will provide a starting and ending value that describe a range of integers, inclusive of the endpoints. Sherlock must determine the number of square integers within that range.
Note: A square integer is an integer which is the square of an integer, e.g. 1,4,9.16,25

Read More

[자바JAVA]Picking Numbers 해커랭크

Picking Numbers

list의 모든 요소들의 절대편차(absolute difference) <= 1 인 가장 긴 list의 길이를 출력하는 문제이다
Given an array of integers, find the longest subarray where the absolute difference between any two elements is less than or equal to 1.

Read More

[자바JAVA]Between Two Sets 해커랭크

Between Two Sets

배열a와 배열b가 주어지고 a요소가 약수이면서 b요소가 배수인 숫자 X가 몇 개인 지 찾는 문제이다.

There will be two arrays of integers. Determine all integers that satisfy the following two conditions:

  1. The elements of the first array are all factors of the integer being considered
  2. The integer being considered is a factor of all elements of the second array
Read More
유튜브 맞춤동영상/추천영상/관련동영상 안뜨게 하기(ft. youtube API 사용법)

유튜브 맞춤동영상/추천영상/관련동영상 안뜨게 하기(ft. youtube API 사용법)

웹 사이트에 iframe으로 유튜브 동영상을 연결을 하면 영상 재생이 끝나면 관련 동영상이 뜬다.
유튜브API를 통해서 관련 동영상 사용 중지할 수 없지만 우회방법이 두 가지 있다.

  1. 반복재생을 통해서 관련 동영상 나올 틈을 주지 않는 방법
  2. rel속성 설정으로 재생된 채널에서 관련 동영상을 가지고 오는 방법

아래 예시를 통해 유튜브 API의 다른 매개변수 사용방법도 익힐 수 있다.

Read More
페이스북 영구 토큰 발급하기

페이스북 영구 토큰 발급하기

[SNS연결하기] FACEBOOK 페이지의 게시글을 웹사이트에 불러오는 방법!
구글링을 정말 많이 했으나 하나같이 제대로 적용되지않았다.
결국 글에서 찾는 건 포기하고 stackoverflow의 댓글 하나하나를 읽으며 테스트했고 끝내 성공했다.
댓글의 중요성을 배웠다. 앞으로는 이걸로 삽질하진 않겠지!!
많은 분들이 나처럼 헤매지않았으면 좋겠다는 마음에서 기록을 남겨본다.

Read More
JSP 페이지 등록일순 역순출력

JSP 페이지 등록일순 역순출력

프로그래머는 매 순간 버그와의 싸움이다.
한 번에 문제 원인을 찾고 해결하면 정말 좋겠지만 아직 나는 많이 부족하다.
그렇게 될 수 있도록 문제상황에 어떻게 원인을 찾고 해결을 했는지 기록하고자 한다.
기억보다 기록은 힘이 세다고 믿으니까.

문제상황

리스트를 idx순으로 출력하는데 순번이상했다.

Read More