일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 방사성동위원소치료
- 폐CT
- 갑상선암용인세브란스
- 입원
- 갑상선암
- 안드로이드
- 임파선전이
- 림프절전이
- 저요오드식
- 알고리즘
- 동위원소치료
- leetcode
- Android Compose
- 정렬 알고리즘
- firebase
- 월간 코드 챌린지 시즌1
- MYSQL
- 방사성 동위원소 치료
- 수술
- 경력 개발자
- 맛집
- 카페
- 전이
- 객체
- Compose
- 프로그래머스
- 용인세브란스병원
- Android
- 백준알고리즘
- java
- Today
- Total
목록알고리즘 (49)
새우버거의 개발 블로그

LeetCode # 1518 Example 1: Input: numBottles = 9, numExchange = 3 Output: 13 Explanation: You can exchange 3 empty bottles to get 1 full water bottle. Number of water bottles you can drink: 9 + 3 + 1 = 13. Constraints: 1

LeetCode # 290 Example 1: Input: pattern = "abba", s = "dog cat cat dog" Output: true Note: 1

LeetCode # 914 Example 1: Input: deck = [1,2,3,4,4,3,2,1] Output: true Explanation: Possible partition [1,1],[2,2],[3,3],[4,4]. Note: 1

LeetCode # 1486 Given an integer n and an integer start. Define an array nums where nums[i] = start + 2*i (0-indexed) and n == nums.length. Return the bitwise XOR of all elements of nums. Example 1: Input: n = 5, start = 0 Output: 8 Explanation: Array nums is equal to [0, 2, 4, 6, 8] where (0 ^ 2 ^ 4 ^ 6 ^ 8) = 8. Where "^" corresponds to bitwise XOR operator. Note: 1
[Lession1] Iterations - BinaryGap 정수 N이 주어졌을 때, N을 이진수로 변환한다. 이진수의 1과 1사이에 있는 0의 개수를 계산하고, 그 최대값을 구하는 문제 app.codility.com/programmers/lessons/1-iterations/binary_gap/ BinaryGap coding task - Learn to Code - Codility Find longest sequence of zeros in binary representation of an integer. app.codility.com Solution while 문으로 정수 N을 String 형으로 이진수로 변환한다. for 반복문으로 '0'과 '1'일 경우를 검사한다. 이때, '0'일 경우 count..

LeetCode # 977 Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: Input: nums = [-4,-1,0,3,10] Output: [0,1,9,16,100] Explanation: After squaring, the array becomes [16,1,0,9,100]. After sorting, it becomes [0,1,9,16,100]. Example 2: Input: nums = [-7,-3,2,3,11] Output: [4,9,9,49,121] Constraints: 1

LeetCode # 1295 Given an array nums of integers, return how many of them contain an even number of digits. Example 1: Input: nums = [12,345,2,6,7896] Output: 2 Explanation: 12 contains 2 digits (even number of digits). 345 contains 3 digits (odd number of digits). 2 contains 1 digit (odd number of digits). 6 contains 1 digit (odd number of digits). 7896 contains 4 digits (even number of digits)...

LeetCode # 485 Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or the last three digits are consecutive 1s. The maximum number of consecutive 1s is 3. Note: The input array will only contain 0 and 1. The length of input array is a positive integer and will not exceed 10,000 Solution #1 (1ms..
백준 알고리즘 10818번 N개의 정수가 주어진다. 이때, 최솟값과 최댓값을 구하는 프로그램을 작성하시오. 입력 첫째 줄에 정수의 개수 N (1 ≤ N ≤ 1,000,000)이 주어진다. 둘째 줄에는 N개의 정수를 공백으로 구분해서 주어진다. 모든 정수는 -1,000,000보다 크거나 같고, 1,000,000보다 작거나 같은 정수이다. 출력 첫째 줄에 주어진 정수 N개의 최솟값과 최댓값을 공백으로 구분해 출력한다. Java (660ms) import java.io.*; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { try { Buffere..
백준 알고리즘 1110번 0보다 크거나 같고, 99보다 작거나 같은 정수가 주어질 때 다음과 같은 연산을 할 수 있다. 먼저 주어진 수가 10보다 작다면 앞에 0을 붙여 두 자리 수로 만들고, 각 자리의 숫자를 더한다. 그 다음, 주어진 수의 가장 오른쪽 자리 수와 앞에서 구한 합의 가장 오른쪽 자리 수를 이어 붙이면 새로운 수를 만들 수 있다. 다음 예를 보자. 26부터 시작한다. 2+6 = 8이다. 새로운 수는 68이다. 6+8 = 14이다. 새로운 수는 84이다. 8+4 = 12이다. 새로운 수는 42이다. 4+2 = 6이다. 새로운 수는 26이다. 위의 예는 4번만에 원래 수로 돌아올 수 있다. 따라서 26의 사이클의 길이는 4이다. N이 주어졌을 때, N의 사이클의 길이를 구하는 프로그램을 작성..