Skip to content

Instantly share code, notes, and snippets.

@ByeongsuPark
ByeongsuPark / solution.java
Created July 27, 2023 03:33
programmers_inquiry_kakao_friends_coloring_book_submission_code_rejected
import java.util.*;
class Solution {
private final int NON_COLORING_AREA = 0;
private final int VISITED = -1;
public int[] solution(int m, int n, int[][] picture) {
int numberOfArea = 0;
int maxSizeOfOneArea = 0;
for (int row = 0; row < picture.length; row++) {
for (int col = 0; col < picture[row].length; col++) {
@ByeongsuPark
ByeongsuPark / solution.java
Created July 27, 2023 03:31
programmers_inquiry_kakao_friends_coloring_book_submission_code_approved
import java.util.*;
class Solution {
private final int NON_COLORING_AREA = 0;
private final int VISITED = -1;
public int[] solution(int m, int n, int[][] pictureOrigin) {
int[][] picture = new int[pictureOrigin.length][pictureOrigin[0].length];
// 배열 복사 ***
for (int row = 0; row < picture.length; row++) {
for (int col = 0; col < picture[row].length; col++) {
@ByeongsuPark
ByeongsuPark / algorithm_test.py
Created November 2, 2018 08:01
유사도 측정 알고리즘 테스트
from urllib.request import urlopen, Request
from bs4 import BeautifulSoup
import numpy as np
headers = {"User-Agent":"Mozilla"}
html = urlopen(Request("https://toonkor.club", headers={'User-Agent': 'Mozilla'}))
blackSiteDB = list()
blackSiteTagDB = list()

아래의 코드는 기본적으로 작동이 되지 않는다. 왜일까? 그것은 바로 포인터에 있다. 배열의 경우에는 배열 이름 자체가 포인터. 메모리 주소 값이기 때문에 전달할 경우 정상적으로 처리가 되나 여기서는 포인터를 넘겨주는 것 '처럼'보이지만 실제로는 쓰레기값을 넘겨준다. 그러므로 포인터를 인자로 넘기고 함수에서 다루기 위해선 포인터의 주소를 넘겨 포인터 그 자체를 다루어야 한다.

@ByeongsuPark
ByeongsuPark / styles.xml
Created June 9, 2018 12:42
How to remove ActionBar and add toolbar
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<!-- blah blah blah.... -->
<item name="windowActionBar">false</item>
<item name="windowNoTitle"><true</item>
<!-- And add toolbar in layout -->
</style>