Web Developer1904 leetcode 7번 - Reverse Integer Given a 32-bit signed integer, reverse digits of an integer. - 주어진 32 비트 부호있는 정수, 정수의 역 자릿수. /** * @param {number} x * @return {number} */ var reverse = function(x) { var max = Math.pow(2, 31) -1, min = -1*(Math.pow(2, 31)); var r = 0, s = '', signed = 1; if(x >= max || x = max || r 2019. 2. 18. leetcode 3 - Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. 주어진 문자열에서 반복되는 문자없이 가장 긴 부분 문자열의 길이를 찾습니다. /** * @param {string} s * @return {number} */ var lengthOfLongestSubstring = function(s) { var r = '', t = '', st = 0; for(let i = 0 ; i < s.length ; i++){ let index = t.indexOf(s[i]); if(index != -1){ st = st + index + 1; } t = s.substring(st, i+1); if(r.length < t.l.. 2019. 2. 18. leetcode 2 - Add Two Numbers Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. 주어진 정수 배열을 이용하여 두 숫자의 인덱스를 반환하여 특정 대상에 합산합니다. 각 입력에는 정확히 하나의 솔루션이 있다고 가정 할 수 있으며 동일한 요소를 두 번 사용할 수 없습니다. /** * Definition for singly-linked list. * function ListNode(val) { * this.val .. 2019. 2. 18. leetcode 1 - Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. 주어진 정수 배열을 이용하여 두 숫자의 인덱스를 반환하여 특정 대상에 합산합니다. 각 입력에는 정확히 하나의 솔루션이 있다고 가정 할 수 있으며 동일한 요소를 두 번 사용할 수 없습니다. /** * @param {number[]} nums * @param {number} target * @return {number[]} */ v.. 2019. 2. 18. SSL 설정 Nginx, Apache SSL 초간단 설정(Nginx, Apache) 1) Nginx (1) HTTP(80) -> HTTPS(443) 리다이렉트 Redirect server { listen 80 default_server; listen [::]:80 default_server; server_name _; return 301 https://$host$request_uri;} (2) HTTPS 443 SSL 설정 server { listen 443 ssl default_server; listen [::]:443 ssl default_server; server_name _; ssl on; ssl_certificate /etc/nginx/ssl/cert.pem; ssl_certificate_key /etc/nginx/ssl/key.p.. 2017. 7. 25. Nginx 서버 설정(conf) 초간단 Nginx Conf 파일 설정 기본적으로는 nginx.conf 파일을 설정해야 하지만 해당 경로 안에 Include 경로가 있기 때문에 보통은 다른 파일을 설정 한다. server { listen 80; // 80 번 포트를 연다 location / { // 루트 경로로 들어왔을 때 이동을 함 proxy_pass http://127.0.0.1:8000; // 80번으로 들어오면 8000번 포트로 이동을 하겠다고 선언 proxy_http_version 1.1; proxy_set_header Connection ""; } location ~ ^/static/ { root /root/static; // /static 경로로 들어온 거는 해당 경로로 포워딩 }} 프록시 패스를 사용하지 않은 경우엔root 변수를.. 2017. 7. 25. 이전 1 ··· 288 289 290 291 292 293 294 ··· 318 다음