1568. Minimum Number of Days to Disconnect Island
Problem Solving 2020. 9. 1. 00:06

Minimum Number of Days to Disconnect Island 아이디어 자체를 생각해내는 것은 어렵지 않은데, 그 아이디어를 코드로 옮기는 건 어려운 문제였다. 결국 다른 사람의 코드를 보고 풀었다. 해당 문제의 기본 아이디어는 다음과 같다. - Island가 0이거나 2이상이면 더이상 계산할 필요가 없다. - 어떠한 경우에도 2이상의 삭제는 불필요 하다. 최악의 경우 [[1,1,1],[1,1,1]] 이라고 해도 (0,0)의 1은 우측 및 하단을 자르면 Island는 2개로 나누어 진다. [1,1] 이렇게 하나의 island로 나와서 결국 2개를 다 삭제 해야 한다고 해도 최대 2개이다. [1,1,1] 이 이상의 경우는 가운데 한개를 삭제 하는 것으로 마무리 된다. 결국 답은 2이상을 넘..

Convert Sorted Array to Binary Search Tree
Problem Solving 2020. 8. 27. 22:26

Convert Sorted Array to Binary Search Tree 산수적인 직관이 중요한데 이걸 잘 못하는거 같다. start, end 처리를 계산하는데 몇 십 분을 썻는지 모르겠다. center = start + Math.round((start - end - 1) / 2) -1 var sortedArrayToBST = function(nums,start=0,end=nums.length-1) { if(end < start) return null; if(start == end) return new TreeNode(nums[start]); let center = start + Math.round((end - start + 1) / 2) - 1; let centerNode = new TreeNode..

Validate Binary Search Tree
Problem Solving 2020. 8. 27. 20:13

Validate Binary Search Tree var isValidBST = function(root) { return dfs(root, -Number.MAX_VALUE, Number.MAX_VALUE); function dfs(node, leftBound, rightBound){ if(node == null) return true; if(node.val = rightBound) return false; return dfs(node.left,leftBound, node.val) && dfs(node.right,node.val, rightBound); } };

AOSP system app install
Android 2020. 8. 20. 11:55

https://stackoverflow.com/questions/40397443/how-to-add-extra-permission-to-a-prebuilt-application-no-source-code-in-aosp How to add extra permission to a prebuilt application (no source code) in AOSP I have an application that doesn't have a specific android permission(for example android.permission.CHANGE_CONFIGURATION). I don't have its source code. I'm working on an AOSP. I prebuilt this sta..

webpack basic with webstorm
Web 2020. 3. 27. 16:40

webstorm 프로젝트 생성 File > New > Project > Empty 프로젝트 생성이후 아래 위치로 들어가서 settings>Language&Frameworks>Node.js and NPM 아래와 같은 node 설정을 해준다 사용 node version 정보 nodejs version : 6.16.0 npm version : 3.10.10 npm module install webpack webpack-cli lodash 상위 세팅이 완료된 이후 npm init 실행을 통해서 package.json을 생성해 준다 이후 기본 webpack 구조를 다음과 같이 만들어 준다 webpack project 기본 구조 webpack-demo |- package.json + |- /src + |- inde..

Vue basic with webstorm
Web 2020. 3. 27. 16:40

전제 nodejs 설치 완료 npm 설치 완료 Npm module Vue-lib : sudo npm install -g @vue/cli Nvm install vue를 써야하는데 nodejs 버전 때문에 문제가 된다면 아래 nvm을 사용 하는게 좋다(?). https://github.com/nvm-sh/nvm 아래는 mac을 기준으로 처리한 내용인데, 주의 할 것은 .bash_profile이 존재하는 곳에서 아래 행위를 해야한다. 시작하기전에 cd ~ 로 홈으로 오자. 만약에 .bash_profile이 없다면 touch .bash_profile로 만들어 주기만 해도 된다. stevenucBookPro:~ steven$ curl -o- https://raw.githubusercontent.com/nvm-sh..

virtual host on centos
OS 2020. 3. 27. 16:39

install 아파치 설치 [root@localhost conf]# yum install httpd [root@localhost conf]# httpd -v Server version: Apache/2.4.6 (CentOS) Server built: Apr 24 2019 13:45:48 방화벽 오픈 [root@localhost conf]# firewall-cmd --permanent --add-service=http [root@localhost conf]# firewall-cmd --permanent --add-service=https [root@localhost conf]# firewall-cmd --reload 상시 서비스 등록 [root@localhost conf]# systemctl enable ..

Virtual Box And Vagrant Install on Centos
OS 2020. 3. 27. 16:39

yum install Dependency Install virtual box에 관련된 라이브러리를 우선 install 한다. yum -y install gcc dkms make qt libgomp patch yum -y install kernel-headers kernel-devel binutils glibc-headers glibc-devel font-forge [devops@localhost ~]$ su 암호: [root@localhost devops]# yum -y install gcc dkms make qt libgomp patch Loaded plugins: fastestmirror, langpacks base | 3.6 kB 00:00:00 docker-ce-stable | 3.5 kB 00:..

tomcat install on centos
Software활용 2020. 3. 27. 16:38

tomca install 처리 하는 내용이지만 별 내용이 없어서... pass [root@localhost webapp]# yum list tomcat* Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: centos.mirror.moack.net * extras: centos.mirror.moack.net * updates: centos.mirror.moack.net Installed Packages tomcat.noarch 7.0.76-9.el7_6 @updates tomcat-admin-webapps.noarch 7.0.76-9.el7_6 @updates tomcat-el-2.2-api...