분류 전체보기
-
포트번호 없이 ip 만으로 접속카테고리 없음 2024. 11. 4. 14:59
기존에는 ip주소에 포트번호 8080까지 붙여줘야만 접속이 가능했다.이걸 간단히 생략하고 ip주소만으로 접속하는 방법에 대해 알아왔다. iptables 설정을 초기화 하고 원하는 포트번호(ex:8080)가 기본값인 80으로 redirection되게 해 주면 된다.$ sudo iptables -F -t nat$ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080 접속이 잘 된다. 예전에 nginx로 해야하는 줄 알고 삽질했던 때가 생각난다.굉장히 간단했다.referencehttps://eng-sohee.tistory.com/105
-
[Sorting] 56. Merge IntervalsSW 정글/운영체제 2024. 10. 24. 00:13
https://leetcode.com/problems/merge-intervals/description/Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. Example 1:Input: intervals = [[1,3],[2,6],[8,10],[15,18]]Output: [[1,6],[8,10],[15,18]]Explanation: Since intervals [1,3] and [2,6] overlap, merge..
-
[Two Pointer] 392. Is SubsequenceSW 정글/알고리즘 2024. 10. 23. 22:26
https://leetcode.com/contest/leetcode-weekly-contest-3/problems/is-subsequence/ Given two strings s and t, return true if s is a subsequence of t, or false otherwise.A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence ..
-
[stack] 20. Valid ParenthesesSW 정글/알고리즘 2024. 10. 23. 16:46
https://leetcode.com/problems/valid-parentheses/description/ Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of brackets.Open brackets must be closed in the correct order.Every close bracket has a corresponding open bracket of the same type. Example 1:..
-
[String] 14. Longest Common Prefix / startswith() 함수SW 정글/알고리즘 2024. 10. 23. 15:34
https://leetcode.com/problems/longest-common-prefix/description/ Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string "". Example 1:Input: strs = ["flower","flow","flight"]Output: "fl"Example 2:Input: strs = ["dog","racecar","car"]Output: ""Explanation: There is no common prefix among the input strings. Constra..
-
[String] 412. Fizz BuzzSW 정글/알고리즘 2024. 10. 23. 14:14
https://leetcode.com/problems/fizz-buzz/description/ Given an integer n, return a string array answer (1-indexed) where:answer[i] == "FizzBuzz" if i is divisible by 3 and 5.answer[i] == "Fizz" if i is divisible by 3.answer[i] == "Buzz" if i is divisible by 5.answer[i] == i (as a string) if none of the above conditions are true.더보기 1부터 n까지의 숫자를 순서대로 출력합니다.각 숫자에 대해 다음 규칙을 따릅니다:숫자가 3의 배수일 경우: "Fiz..
-
[math] 7. Reverse IntegerSW 정글/알고리즘 2024. 10. 23. 13:53
https://leetcode.com/problems/reverse-integer/description/ Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0.Assume the environment does not allow you to store 64-bit integers (signed or unsigned). Example 1:Input: x = 123Output: 321Example 2:Input: x = -123Output: -321E..
-
[math] 9. Palindrome-numberSW 정글/알고리즘 2024. 10. 23. 12:49
https://leetcode.com/problems/palindrome-number/description/ Given an integer x, return true if x is a palindrome, and false otherwise. Example 1:Input: x = 121Output: trueExplanation: 121 reads as 121 from left to right and from right to left. Example 2:Input: x = -121Output: falseExplanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindr..