반응형 Leetcode11 Leetcode <Binary Search> 704. Binary Search 50.8% Easy Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If target exists, then return its index, otherwise return -1. 해석부터 안됨 예제를 보자 Example 1: Input: nums = [-1,0,3,5,9,12], target = 9 Output: 4 Explanation: 9 exists in nums and its index is 4 Example 2: Input: nums = [-1,0,3,5,9,12], target = 2 Output: -1 Explanation: .. 2020. 4. 10. Leetcode <Sort> 242. Valid Anagram 백준 6996번 애너그램 백준 6996번 문제랑 똑같음 Leetcode class Solution { public boolean isAnagram(String s, String t) { PriorityQueue heap = new PriorityQueue(); PriorityQueue heap2 = new PriorityQueue(); for(int i=0; i 2020. 4. 5. Leetcode 328. Odd Even Linked List 52.5% Medium 스터디 문제4번 LinkedList 정답률 52.5% https://blog.naver.com/1ilsang/221597552829 LeetCode 328. Odd Even Linked List - LinkedList(in Place) https://leetcode.com/problems/odd-even-linked-list/submissions/링크드 리스트 문제인데, O(1) 의 공간... blog.naver.com class Solution { public ListNode oddEvenList(ListNode head) { ListNode odd = head; if(odd == null) return head; ListNode even = head.next; if(even == null || eve.. 2020. 4. 3. Leetcode 621. Task Scheduler 47.7% Medium 스터디 문제3번 Queue 정답률 47.7% 2020. 4. 3. 이전 1 2 3 다음 반응형