일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- mock stub spy
- webpack
- Spock Mock
- TypeScript
- enum
- mock stub
- @Transaction propagation
- Vue+Typescript
- nuxtjs/composition-api buildModules
- ECMAScript
- frontend
- 의존성주입
- Javascript
- Spock Mock Stub Spy
- Spock Stub
- HTTP란
- 트랜잭션 격리
- DI
- 자바스크립트
- vue store
- 공짜로 Docker Desktop같은거 쓰기
- Mock vs Stub
- 타입스크립트
- Spock Spy
- @Transaction isolation
- TCP/IP
- Rancher Desktop설치
- Docker Desktop 쓰고싶다
- docker desktop 유료화 정책
- docker desktop 대체
- Today
- Total
목록 Computer Science/Algorithm (4)
끄적끄적

회문 알고리즘 - 숫자 class Solution { public boolean isPalindrome(int x) { if ( x < 0 ) return false; String str = Integer.toString(x); int middle = str.length()/2; for (int i = 0; i < middle; i++) { if ( str.charAt(i) != str.charAt(str.length()-i-1) ) { return false; } } return true; } } runtime - 7ms memory - 38.9 mb

class Solution { public int reverse(int x) { long res = 0; while (x != 0) { res = res * 10 + x % 10; x = x / 10; } if (res Integer.MAX_VALUE) { return 0; } else { return (int)res; } } } runtime - 1ms memory - 36.6mb

class Solution { public String longestPalindrome(String s) { if (s == null || "".equals(s)) { return s; } int len = s.length(); int max = 0; String answer = ""; boolean[][] dp = new boolean[len][len]; for (int j = 0; j max) { max = j - i + 1; answer = s.substring(i, j + 1); } } } return answer; } }..

java class Solution { public int[] twoSum(int[] nums, int target) { for (int i = 0; i < nums.length; i++) { for (int j = i + 1; j < nums.length; j++) { if (nums[j] == target - nums[i]) { return new int[] { i, j }; } } } throw new IllegalArgumentException("No two sum solution"); } }javascript /** * @param {number[]} nums * @param {number} target * @return {number[]} */ var twoSum = function(nums,..