일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Class
- Python Implementation
- Python Code
- attribute
- shiba
- 운영체제
- Decorator
- t1
- 30. Substring with Concatenation of All Words
- Python
- Protocol
- 315. Count of Smaller Numbers After Self
- 프로그래머스
- 109. Convert Sorted List to Binary Search Tree
- concurrency
- DWG
- Convert Sorted List to Binary Search Tree
- 시바견
- Regular Expression
- LeetCode
- 43. Multiply Strings
- kaggle
- Substring with Concatenation of All Words
- Generator
- 715. Range Module
- data science
- 밴픽
- iterator
- 컴퓨터의 구조
- 파이썬
- Today
- Total
목록분류 전체보기 (407)
Scribbling
class Solution { public int[] twoSum(int[] nums, int target) { Map map = new HashMap(); for (int i=0; i
class Solution { public boolean isAnagram(String s, String t) { if (s.length() != t.length()) return false; Map counter1 = new HashMap(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); counter1.merge(c, 1, Integer::sum); } Map counter2 = new HashMap(); for (int i = 0; i < t.length(); i++) { char c = t.charAt(i); counter2.merge(c, 1, Integer::sum); } for (Character c : counter1.keyS..
class Solution { public boolean containsDuplicate(int[] nums) { Set numSet = new HashSet( Arrays.stream(nums).boxed().collect(Collectors.toSet()) ); return nums.length != numSet.size(); } }
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode() {} * ListNode(int val) { this.val = val; } * ListNode(int val, ListNode next) { this.val = val; this.next = next; } * } */ class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode ret = new ListNode(); ListNode cur = ret; int carry = 0; while (l1 != null || l2 !=..
class Solution { public List threeSum(int[] nums) { List ret = new ArrayList(); Arrays.sort(nums); int N = nums.length; for (int i = 0; i 0 && nums[i] == nums[i-1]) { continue; } int j = i + 1, k = N - 1; while (j < k) { int n1 = nums[i], n2 = nums[j], n3 = nums[k]; int sum = n1 + n2 + n3; if (sum == 0) { List temp = List.of(n1, n2, n3); ret.add(temp); while (j < k && num..
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/bdmbKh/btr1udwz6rP/706v0kKKKzOzo8QsPXIpD1/img.png)
5장 1. ==과 != 기본 타입의 경우 값을 비교하지만, 참조 타입의 경우는 주소값을 저장하므로 ==로 비교하면 같은 객체인지를 확인한다. 참조 타입 변수는 null을 가질 수 있다. null과의 비교는 == 혹은 !=를 사용함. 2. 배열의 생성 char[] chars = { 'a', 'b', 'c', 'a' }; 3. 2차원 배열 int[][] scores = new int[5][]; 6장 1. 클래스 - 하나의 소스 파일에 소스 파일명과 동일한 클래스만 public class로 사용 가능함 - 여러 개의 클래스를 선언한 소스 파일을 컴파일하면 클래스 선언 수만큼 바이트코드 파일(.class)이 생김 - 흔히 자바 프로그램은 하나의 실행 클래스와 여러 개의 라이브러리 클라스로 이루어짐 2. 생성자 ..
This post will briefly summarize things I picked up about Java. I'll only handle stuff that is totally different from Python, C++, JavaScript context & syntax. In Java, all classes are Reference Types. Except for primitive types, all the instances or objects are stored on Heap. 1. String 1.1. Methods charAt(int): The charAt method accepts an index value as its input and returns the character loc..
#include #include class Solution { public: vector threeSum(vector& nums) { using namespace std; sort(nums.begin(), nums.end()); vector ret; for (size_t i=0; i 0 and nums[i] == nums[i-1]) { continue; } size_t j = i + 1, k = nums.size() - 1; while (j < k) { int num1 = nums.at(i), num2 = nums.at(j), num3 = nums.at(k); int summed = num1 + num2 + num3; if (summed == 0) { vector temp = {num1, num2, nu..
First thing first: To implement an expression tree with "Postfix", we can easily do so with a stack. For the evaluation part: "ABC" might be a bit unfamiliar, but all you need to know about it here is that you cannot initiate an instance with the ABC class (in this case Node class). In addition, an abstract method must be implemented in the child class. import abc from abc import ABC, abstractme..
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { ListNode* curPtr = new ListNode(0); ListNode* ret = curPtr; int sum=0, carry =..