목록분류 전체보기 (62)
아무고토 몰라효
Is Subsequence문제Given two strings s and t, return true if s is a subsequence of t, or false otherwise.A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not).Example 1:Input: s = "abc", t = "..
Find the Difference문제You are given two strings s and t.String t is generated by random shuffling string s and then add one more letter at a random position.Return the letter that was added to t.Example 1:Input: s = "abcd", t = "abcde"Output: "e"Explanation: 'e' is the letter that was added.Example 2:Input: s = "", t = "y"Output: "y"Constraints:0 t.length == s.length + 1s and t consist of lowerca..

https://leetcode.com/problems/reverse-string문제Write a function that reverses a string. The input string is given as an array of characters s.You must do this by modifying the input array in-place with O(1) extra memory.Example 1:Input: s = ["h","e","l","l","o"] Output: ["o","l","l","e","h"]Example 2:Input: s = ["H","a","n","n","a","h"] Output: ["h","a","n","n","a","H"]Constraints:- 1 ⁵- s[i] is ..

문제Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:1. Open brackets must be closed by the same type of brackets.2. Open brackets must be closed in the correct order.3. Every close bracket has a corresponding open bracket of the same type.Example 1:Input: s = "()"Output: trueExample 2:Input: s = "()..

https://leetcode.com/problems/longest-common-prefix문제Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string "".Example 1:Input: strs = ["flower","flow","flight"] Output: "fl"Example 2:Input: strs = ["dog","racecar","car"] Output: "" Explanation: There is no common prefix among the input strings.Constraints:- 1 - ..

https://leetcode.com/problems/roman-to-integer문제Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.SymbolValueI1V5X10L50C100D500M1000For example, 2 is written as II in Roman numeral, just two ones added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II.Roman numerals are usually written largest to smalle..

https://leetcode.com/problems/palindrome-number문제Given an integer x, return true if x is a palindrome, and false otherwise.Example 1:Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left.Example 2:Input: x = -121 Output: false Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.Example..

https://leetcode.com/problems/two-sum/문제Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.You may assume that each input would have exactly one solution, and you may not use the same element twice.You can return the answer in any order.Example 1:Input: nums = [2,7,11,15], target = 9 Output: [0,1] Explanation: Because nums[0] ..

안녕하세요! 🙋🏻♀️Android 의 Context 에 대해 간략하게 작성해봅니다.📌 Context 란- 어플리케이션의 현재 상태를 나타낸다.- Activity 와 어플리케이션의 정보를 얻기 위해 사용할 수 있다.- 리소스, 데이터베이스, Shared preference 등 접근하기 위해 사용할 수 있다.- Activity와 어플리케이션 클래스는 Context 클래스를 확장한 클래스이다. 📌 Application Context- Application Context 는 싱글톤 인스턴스이며, Activity 에서 `getApplicationContext()` 를 통해 접근할 수 있다.- 해당 Context 는 Application 라이프사이클에 묶여있으며, 현재 Context 가 종료된 이후에도 C..

👼🏻 초보 안드로이드 개발자가 매번 구글링하기 싫어서 정리하는 블로그 👼🏻안녕하세요! 🙋🏻♀️Annotation 에 관해 작성해 보았습니다.Annotation 이란?소스 코드에 메타데이터를 추가하는 방법 중 하나.해당 메타데이터는 컴파일러나 다른 도구가 소스 코드를 처리하거나 실행할 때 정보를 제공한다.또한 코드를 더 간결하고 가독성있게 만들고, 런타임 동작을 변경하거나 개선하는데 도움이 된다.Resource 관련 Annotation [[참고 사이트#1]]메서드나 지역 변수, 필드 반환 값이 리소스 참조가 될 것으로 예상됨을 나타낸다.@AnimatorRes : animator 리소스 참조 (android.R.animator.)@AnimRes : anim 리소스 참조 (android.R.ani..