본문 바로가기

전체 글234

[Kotlin] 에러(Error)와 예외(Exception) https://inpa.tistory.com/entry/JAVA-%E2%98%95-%EC%97%90%EB%9F%ACError-%EC%99%80-%EC%98%88%EC%99%B8-%ED%81%B4%EB%9E%98%EC%8A%A4Exception-%F0%9F%92%AF-%EC%B4%9D%EC%A0%95%EB%A6%AC ☕ 자바 에러(Error) 와 예외 클래스(Exception) 💯 이해하기프로그래밍의 오류 종류 프로그램에서 오류가 발생하면 시스템 레벨에서 프로그램에 문제를 야기하여 원치 않는 버그를 일으키거나, 심각하면 실행 중인 프로그램을 강제로 종료시키도 한다.inpa.tistory.com에러(error) : 프로그램 코드에 의해서 수습될 수 없는 심각한 오류예외(exception) : 프로그램 코드.. 2024. 11. 20.
[Data Structure][Kotlin] 해시(Hash) 해시(Hash)단방향 암호화 기법평문을 암호문으로 바꾸는 암호화는 가능하지만, 암호문을 평문으로 바꾸는 복호화는 불가능하다.입력된 값을 산술 연산을 통해 출력 데이터가 있는 위치를 식별할 수 있는 값으로 변환하는 것*해시 함수를 통해 입력 값이 데이터가 있는 곳을 알 수 있는 출력 값으로 연결될 수 있으므로, 해시 함수는 입력 값을 출력 값으로 mapping(매핑)해주는 함수라고도 한다.해시 함수 : 임의의 길이를 가진 데이터를 입력받아 고정된 길이의 값, 즉 해시값을 출력하는 함수 해시 맵(HashMap), 해시 테이블(Hash Table)해시 기법을 사용하여 데이터를 보관하는 자료구조데이터에 접근하거나 검색할 때 데이터들을 순회하면서 일일이 비교하는 일반적인 자료구조와 다르게 key 값을 통해 한 번.. 2024. 11. 19.
[LeetCode][Kotlin] 76. Minimum Window Substring 76. Minimum Window SubstringGiven two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "". The testcases will be generated such that the answer is unique.각각 길이가 m과 n인 두 개의 문자열 s와 t가 주어지면 t의 모든 문자(중복 포함)가 윈도우에 포함되도록 s의 최소 .. 2024. 11. 18.
[Compose] 목록 및 그리드 목록 및 그리드  |  Jetpack Compose  |  Android Developers이 페이지는 Cloud Translation API를 통해 번역되었습니다. 목록 및 그리드 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. 많은 앱에서 항목의 컬렉션을 표시해developer.android.com@Composablefun MessageList(messages: List) { Column { messages.forEach { message -> MessageRow(message) } }}스크롤이 필요하지 않은 경우 (방향에 따라) 간단한 Column 또는 Row 를 사용하여 다음과 같이 목록을 반복하여 각 항목의 콘.. 2024. 11. 17.
[LeetCode][Kotlin] 2962. Count Subarrays Where Max Element Appears at Least K Times 2962. Count Subarrays Where Max Element Appears at Least K TimesYou are given an integer array nums and a positive integer k. Return the number of subarrays where the maximum element of nums appears at least k times in that subarray. A subarray is a contiguous sequence of elements within an array.정수 배열 nums와 양의 정수 k가 주어집니다. nums의 최대 요소가 해당 하위 배열에 최소 k번 나타나는 하위 배열의 개수를 반환합니다. 하위 배열은 배열 내의 연속된 요소 .. 2024. 11. 16.
[LeetCode][Kotlin] 930. Binary Subarrays With Sum 930. Binary Subarrays With SumGiven a binary array nums and an integer goal, return the number of non-empty subarrays with a sum goal. A subarray is a contiguous part of the array.이진 배열 nums와 정수 goal이 주어지면, sum goal을 사용하여 비어 있지 않은 부분 배열의 개수를 반환합니다. 부분 배열은 배열의 연속된 부분입니다. Example 1:Input: nums = [1,0,1,0,1], goal = 2Output: 4Explanation: The 4 subarrays are bolded and underlined below:[1,0,1,0,1][.. 2024. 11. 15.
[LeetCod][Kotlin] 948. Bag of Tokens 948. Bag of TokensYou start with an initial power of power, an initial score of 0, and a bag of tokens given as an integer array tokens, where each tokens[i] denotes the value of tokeni. Your goal is to maximize the total score by strategically playing these tokens. In one move, you can play an unplayed token in one of the two ways (but not both for the same token):Face-up: If your current power.. 2024. 11. 14.